]> gitweb.factorcode.org Git - factor.git/blob - extra/google/charts/charts-tests.factor
a62e681c1709d3c4f49aa8c94dbfdc46f89ce63a
[factor.git] / extra / google / charts / charts-tests.factor
1 ! Copyright (C) 2016 Alexander Ilin.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors colors.constants google.charts
4 google.charts.private kernel math present sequences tools.test ;
5
6 ! The order of the constructors below is important, because we
7 ! are testing side-effects. If you remove the clone word from
8 ! chart>url implementation, the second object in each test
9 ! will incorrectly result in the same URL as the first one
10 ! (although the order of parameters in the URL may vary).
11 ! The order of tests is important for the same reason.
12
13 { t } [
14     "" <formula> t >>data-scale
15     "" <formula>
16     [ chart>url present length ] bi@ >
17 ] unit-test
18
19 { t } [
20     { 0 0 } <line>
21     { 0 0 } <line> f >>width f >>height
22     [ chart>url present length ] bi@ >
23 ] unit-test
24
25 { t } [
26     { 0 0 } <line> COLOR: red >>background
27     { 0 0 } <line>
28     [ chart>url present length ] bi@ >
29 ] unit-test
30
31 { t } [
32     { 0 0 } <line> COLOR: red >>foreground
33     { 0 0 } <line>
34     [ chart>url present length ] bi@ >
35 ] unit-test
36
37 { t } [
38     { 0 0 } <line> { 0 0 } >>margin
39     { 0 0 } <line>
40     [ chart>url present length ] bi@ >
41 ] unit-test
42
43 { t } [
44     { 0 0 } <line> 5 >>bar-width
45     { 0 0 } <line>
46     [ chart>url present length ] bi@ >
47 ] unit-test