Skip to content

Commit 69d7c6e

Browse files
committed
Add make check support
1 parent 9fb9361 commit 69d7c6e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
extern crate extra;
99
extern crate encoding; // https://github.com/lifthrasiir/rust-encoding
1010

11+
#[cfg(test)]
12+
extern crate test;
13+
1114
pub use tokenizer::tokenize;
1215
pub use parser::{parse_stylesheet_rules, parse_rule_list, parse_declaration_list,
1316
parse_one_rule, parse_one_declaration, parse_one_component_value};

tests.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
use std::{str, run, task};
6-
use std::io;
7-
use std::io::{File, Writer};
5+
use std::{io, str, task};
6+
use std::io::{File, Process, Writer};
87
use extra::{tempfile, json};
98
use extra::json::ToJson;
10-
use extra::test;
9+
use test;
1110

1211
use encoding::label::encoding_from_whatwg_label;
1312

@@ -17,8 +16,8 @@ use ast::*;
1716

1817
fn write_whole_file(path: &Path, data: &str) {
1918
match File::open_mode(path, io::Open, io::Write) {
20-
Some(mut writer) => writer.write(data.as_bytes()),
21-
None => fail!("could not open file"),
19+
Ok(mut writer) => { writer.write(data.as_bytes()); },
20+
_ => fail!("could not open file"),
2221
}
2322
}
2423

@@ -49,8 +48,8 @@ fn assert_json_eq(results: json::Json, expected: json::Json, message: ~str) {
4948
expected_path.push("expected.json");
5049
write_whole_file(&result_path, results);
5150
write_whole_file(&expected_path, expected);
52-
run::process_status("colordiff", [~"-u1000", result_path.display().to_str(),
53-
expected_path.display().to_str()]);
51+
Process::status("colordiff", [~"-u1000", result_path.display().to_str(),
52+
expected_path.display().to_str()]);
5453
});
5554
5655
fail!(message)

0 commit comments

Comments
 (0)