Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/cfg/src/tests.rs')
| -rw-r--r-- | crates/cfg/src/tests.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/cfg/src/tests.rs b/crates/cfg/src/tests.rs index 62fb429a63..a1ae15fcdd 100644 --- a/crates/cfg/src/tests.rs +++ b/crates/cfg/src/tests.rs @@ -1,12 +1,12 @@ use arbitrary::{Arbitrary, Unstructured}; use expect_test::{expect, Expect}; use mbe::{syntax_node_to_token_tree, DummyTestSpanMap, DUMMY}; -use syntax::{ast, AstNode}; +use syntax::{ast, AstNode, Edition}; use crate::{CfgAtom, CfgExpr, CfgOptions, DnfExpr}; fn assert_parse_result(input: &str, expected: CfgExpr) { - let source_file = ast::SourceFile::parse(input).ok().unwrap(); + let source_file = ast::SourceFile::parse(input, Edition::CURRENT).ok().unwrap(); let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap(); let tt = syntax_node_to_token_tree(tt.syntax(), DummyTestSpanMap, DUMMY); let cfg = CfgExpr::parse(&tt); @@ -14,7 +14,7 @@ fn assert_parse_result(input: &str, expected: CfgExpr) { } fn check_dnf(input: &str, expect: Expect) { - let source_file = ast::SourceFile::parse(input).ok().unwrap(); + let source_file = ast::SourceFile::parse(input, Edition::CURRENT).ok().unwrap(); let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap(); let tt = syntax_node_to_token_tree(tt.syntax(), DummyTestSpanMap, DUMMY); let cfg = CfgExpr::parse(&tt); @@ -23,7 +23,7 @@ fn check_dnf(input: &str, expect: Expect) { } fn check_why_inactive(input: &str, opts: &CfgOptions, expect: Expect) { - let source_file = ast::SourceFile::parse(input).ok().unwrap(); + let source_file = ast::SourceFile::parse(input, Edition::CURRENT).ok().unwrap(); let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap(); let tt = syntax_node_to_token_tree(tt.syntax(), DummyTestSpanMap, DUMMY); let cfg = CfgExpr::parse(&tt); @@ -34,7 +34,7 @@ fn check_why_inactive(input: &str, opts: &CfgOptions, expect: Expect) { #[track_caller] fn check_enable_hints(input: &str, opts: &CfgOptions, expected_hints: &[&str]) { - let source_file = ast::SourceFile::parse(input).ok().unwrap(); + let source_file = ast::SourceFile::parse(input, Edition::CURRENT).ok().unwrap(); let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap(); let tt = syntax_node_to_token_tree(tt.syntax(), DummyTestSpanMap, DUMMY); let cfg = CfgExpr::parse(&tt); |