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