Skip to content

Commit e2927cc

Browse files
author
bors-servo
authored
Auto merge of #285 - servo:testup, r=SimonSapin
Update rustc-test to 0.2, fix breakage on Nightly <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/html5ever/285) <!-- Reviewable:end -->
2 parents fd514b9 + 19ba3e5 commit e2927cc

File tree

7 files changed

+13
-32
lines changed

7 files changed

+13
-32
lines changed

html5ever/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ markup5ever = { version = "0.3", path = "../markup5ever" }
4040

4141
[dev-dependencies]
4242
rustc-serialize = "0.3.15"
43-
rustc-test = "0.1.3"
43+
rustc-test = "0.2"
4444

4545
[build-dependencies]
4646
quote = "0.3.3"

html5ever/benches/tokenizer.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use std::default::Default;
1616

1717
use test::{black_box, Bencher, TestDesc, TestDescAndFn};
1818
use test::{DynTestName, DynBenchFn, TDynBenchFn};
19-
use test::ShouldPanic::No;
2019

2120
use html5ever::tokenizer::{BufferQueue, TokenSink, Token, Tokenizer, TokenizerOpts, TokenSinkResult};
2221
use html5ever::tendril::*;
@@ -108,17 +107,13 @@ impl TDynBenchFn for Bench {
108107
fn make_bench(name: &str, size: Option<usize>, clone_only: bool,
109108
opts: TokenizerOpts) -> TestDescAndFn {
110109
TestDescAndFn {
111-
desc: TestDesc {
112-
name: DynTestName([
113-
"tokenize ".to_string(),
114-
name.to_string(),
115-
size.map_or("".to_string(), |s| format!(" size {:7}", s)),
116-
(if clone_only { " (clone only)" } else { "" }).to_string(),
117-
(if opts.exact_errors { " (exact errors)" } else { "" }).to_string(),
118-
].concat().to_string()),
119-
ignore: false,
120-
should_panic: No,
121-
},
110+
desc: TestDesc::new(DynTestName([
111+
"tokenize ".to_string(),
112+
name.to_string(),
113+
size.map_or("".to_string(), |s| format!(" size {:7}", s)),
114+
(if clone_only { " (clone only)" } else { "" }).to_string(),
115+
(if opts.exact_errors { " (exact errors)" } else { "" }).to_string(),
116+
].concat().to_string())),
122117
testfn: DynBenchFn(Box::new(Bench::new(name, size, clone_only, opts))),
123118
}
124119
}

html5ever/tests/tokenizer.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use std::mem::replace;
2020
use std::default::Default;
2121
use std::path::Path;
2222
use test::{TestDesc, TestDescAndFn, DynTestName, DynTestFn};
23-
use test::ShouldPanic::No;
2423
use rustc_serialize::json::Json;
2524
use std::collections::BTreeMap;
2625
use std::borrow::Cow::Borrowed;
@@ -314,11 +313,7 @@ fn unescape_json(js: &Json) -> Json {
314313
fn mk_test(desc: String, input: String, expect: Json, opts: TokenizerOpts)
315314
-> TestDescAndFn {
316315
TestDescAndFn {
317-
desc: TestDesc {
318-
name: DynTestName(desc),
319-
ignore: false,
320-
should_panic: No,
321-
},
316+
desc: TestDesc::new(DynTestName(desc)),
322317
testfn: DynTestFn(Box::new(move || {
323318
// Split up the input at different points to test incremental tokenization.
324319
let insplits = splits(&input, 3);

html5ever/tests/tree_builder.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::default::Default;
2222
use std::path::Path;
2323
use std::collections::{HashSet, HashMap};
2424
use test::{TestDesc, TestDescAndFn, DynTestName, TestFn};
25-
use test::ShouldPanic::No;
2625

2726
use html5ever::{LocalName, QualName};
2827
use html5ever::{ParseOpts, parse_document, parse_fragment};
@@ -199,9 +198,8 @@ fn make_test_desc_with_scripting_flag(
199198

200199
TestDescAndFn {
201200
desc: TestDesc {
202-
name: DynTestName(name),
203201
ignore: ignore,
204-
should_panic: No,
202+
.. TestDesc::new(DynTestName(name))
205203
},
206204
testfn: TestFn::dyn_test_fn(move || {
207205
// Do this here because Tendril isn't Send.

xml5ever/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ markup5ever = {version = "0.3", path = "../markup5ever" }
2929

3030
[dev-dependencies]
3131
rustc-serialize = "0.3.15"
32-
rustc-test = "0.1.3"
32+
rustc-test = "0.2"

xml5ever/tests/tokenizer.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use std::collections::BTreeMap;
2020
use rustc_serialize::json::Json;
2121

2222
use test::{TestDesc, TestDescAndFn, DynTestName, DynTestFn};
23-
use test::ShouldPanic::No;
2423
use util::find_tests::foreach_xml5lib_test;
2524

2625
use xml5ever::{LocalName, Attribute, QualName};
@@ -281,11 +280,7 @@ fn json_to_tokens(js: &Json, exact_errors: bool) -> Vec<Token> {
281280
fn mk_xml_test(desc: String, input: String, expect: Json, opts: XmlTokenizerOpts)
282281
-> TestDescAndFn {
283282
TestDescAndFn {
284-
desc: TestDesc {
285-
name: DynTestName(desc),
286-
ignore: false,
287-
should_panic: No,
288-
},
283+
desc: TestDesc::new(DynTestName(desc)),
289284
testfn: DynTestFn(Box::new(move || {
290285
// Split up the input at different points to test incremental tokenization.
291286
let insplits = splits(&input, 3);

xml5ever/tests/tree_builder.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use std::path::Path;
2323

2424

2525
use test::{TestDesc, TestDescAndFn, DynTestName, DynTestFn};
26-
use test::ShouldPanic::No;
2726
use util::find_tests::foreach_xml5lib_test;
2827
use xml5ever::rcdom::*;
2928
use xml5ever::driver::parse_document;
@@ -186,9 +185,8 @@ fn make_xml_test(
186185

187186
tests.push(TestDescAndFn {
188187
desc: TestDesc {
189-
name: DynTestName(name),
190188
ignore: ignore,
191-
should_panic: No,
189+
.. TestDesc::new(DynTestName(name))
192190
},
193191
testfn: DynTestFn(Box::new(move || {
194192
let mut result = String::new();

0 commit comments

Comments
 (0)