@@ -57,17 +57,9 @@ fn run_json_tests(json_data: &str, parse: &fn (input: ~str) -> json::Json) {
57
57
}
58
58
59
59
60
- // JSON files are in https://github.com/SimonSapin/tinycss2/tree/master/tinycss2/tests
61
- // TODO: use git subtree or something to have them in this repository.
62
-
63
-
64
60
#[ test]
65
61
fn component_value_list ( ) {
66
- do run_json_tests ( include_str ! (
67
- // https://github.com/SimonSapin/tinycss2/tree/master/tinycss2/tests
68
- // TODO: use git subtree or something to have the JSON files in this repository.
69
- "../tinycss2/tinycss2/tests/component_value_list.json"
70
- ) ) |input| {
62
+ do run_json_tests ( include_str ! ( "json-tests/component_value_list.json" ) ) |input| {
71
63
let mut parser = Parser :: from_str ( input) ;
72
64
let mut results = ~[ ] ;
73
65
loop {
@@ -83,7 +75,7 @@ fn component_value_list() {
83
75
84
76
#[ test]
85
77
fn one_component_value ( ) {
86
- do run_json_tests ( include_str ! ( "../tinycss2/tinycss2/ tests/one_component_value.json" ) ) |input| {
78
+ do run_json_tests ( include_str ! ( "json- tests/one_component_value.json" ) ) |input| {
87
79
let mut iter = ComponentValueIterator :: from_str ( input) ;
88
80
match iter. next_non_whitespace ( ) {
89
81
None => json:: List ( ~[ json:: String ( ~"error") , json:: String ( ~"empty") ] ) ,
@@ -98,7 +90,7 @@ fn one_component_value() {
98
90
99
91
#[ test]
100
92
fn declaration_list ( ) {
101
- do run_json_tests ( include_str ! ( "../tinycss2/tinycss2/ tests/declaration_list.json" ) ) |input| {
93
+ do run_json_tests ( include_str ! ( "json- tests/declaration_list.json" ) ) |input| {
102
94
let mut iter = ComponentValueIterator :: from_str ( input) ;
103
95
let mut declarations = ~[ ] ;
104
96
loop {
@@ -117,7 +109,7 @@ fn declaration_list() {
117
109
118
110
#[ test]
119
111
fn one_declaration ( ) {
120
- do run_json_tests ( include_str ! ( "../tinycss2/tinycss2/ tests/one_declaration.json" ) ) |input| {
112
+ do run_json_tests ( include_str ! ( "json- tests/one_declaration.json" ) ) |input| {
121
113
match parse_one_declaration ( & mut ComponentValueIterator :: from_str ( input) ) {
122
114
Ok ( declaration) => declaration. to_json ( ) ,
123
115
Err ( reason) => reason. to_json ( ) ,
@@ -128,7 +120,7 @@ fn one_declaration() {
128
120
129
121
#[ test]
130
122
fn rule_list ( ) {
131
- do run_json_tests ( include_str ! ( "../tinycss2/tinycss2/ tests/rule_list.json" ) ) |input| {
123
+ do run_json_tests ( include_str ! ( "json- tests/rule_list.json" ) ) |input| {
132
124
let mut iter = ComponentValueIterator :: from_str ( input) ;
133
125
let mut rules = ~[ ] ;
134
126
loop {
@@ -147,7 +139,7 @@ fn rule_list() {
147
139
148
140
#[ test]
149
141
fn one_rule ( ) {
150
- do run_json_tests ( include_str ! ( "../tinycss2/tinycss2/ tests/one_rule.json" ) ) |input| {
142
+ do run_json_tests ( include_str ! ( "json- tests/one_rule.json" ) ) |input| {
151
143
match parse_one_rule ( & mut ComponentValueIterator :: from_str ( input) ) {
152
144
Ok ( rule) => rule. to_json ( ) ,
153
145
Err ( reason) => reason. to_json ( ) ,
0 commit comments