Fix tests (#142)

This commit is contained in:
강동윤 2019-02-10 20:49:29 +09:00 committed by GitHub
parent 605019280f
commit ab4f619257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 9 deletions

View File

@ -92,7 +92,7 @@ fn emit_colors(b: &mut Bencher) {
let _ = ::testing::run_test(true, |cm, handler| {
let session = Session { handler: &handler };
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
session,
Syntax::default(),

View File

@ -55,7 +55,7 @@ fn bench_module(b: &mut Bencher, src: &'static str) {
let _ = ::testing::run_test(false, |cm, handler| {
let session = Session { handler: &handler };
let fm = cm.new_source_file(FileName::Anon(0), src.into());
let fm = cm.new_source_file(FileName::Anon, src.into());
b.iter(|| {
let _ = test::black_box({

View File

@ -135,6 +135,7 @@ where
Syntax::Typescript(TsConfig {
tsx: fname.contains("tsx"),
decorators: true,
..Default::default()
}),
(&*fm).into(),
None,

View File

@ -89,7 +89,7 @@ module.exports = {
#[bench]
fn module_clone(b: &mut Bencher) {
let _ = ::testing::run_test(false, |cm, handler| {
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
Session { handler: &handler },
@ -116,7 +116,7 @@ fn fold_empty(b: &mut Bencher) {
struct Noop;
let _ = ::testing::run_test(false, |cm, handler| {
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
Session { handler: &handler },
@ -154,7 +154,7 @@ fn fold_noop_impl_all(b: &mut Bencher) {
b.bytes = SOURCE.len() as _;
let _ = ::testing::run_test(false, |cm, handler| {
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
Session { handler: &handler },
@ -192,7 +192,7 @@ fn fold_noop_impl_vec(b: &mut Bencher) {
b.bytes = SOURCE.len() as _;
let _ = ::testing::run_test(false, |cm, handler| {
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
Session { handler: &handler },
@ -275,7 +275,7 @@ fn visit_empty(b: &mut Bencher) {
struct Noop;
let _ = ::testing::run_test(false, |cm, handler| {
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
Session { handler: &handler },
@ -328,7 +328,7 @@ fn visit_contains_this(b: &mut Bencher) {
b.bytes = SOURCE.len() as _;
let _ = ::testing::run_test(false, |cm, handler| {
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
Session { handler: &handler },

View File

@ -94,7 +94,7 @@ macro_rules! tr {
$b.bytes = SOURCE.len() as _;
let _ = ::testing::run_test(false, |cm, handler| {
let fm = cm.new_source_file(FileName::Anon(0), SOURCE.into());
let fm = cm.new_source_file(FileName::Anon, SOURCE.into());
let mut parser = Parser::new(
Session { handler: &handler },