From 459241f272748ff2e57b2c7e84f5a04f78d67edb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 24 Jul 2019 12:38:21 +0300 Subject: move syntax tests to unit tests --- .../test_data/lexer/00012_block_comment.rs | 4 ++ .../test_data/lexer/00012_block_comment.txt | 7 ++ crates/ra_syntax/test_data/lexer/0001_hello.rs | 1 + crates/ra_syntax/test_data/lexer/0001_hello.txt | 3 + .../ra_syntax/test_data/lexer/0002_whitespace.rs | 4 ++ .../ra_syntax/test_data/lexer/0002_whitespace.txt | 12 ++++ crates/ra_syntax/test_data/lexer/0003_ident.rs | 1 + crates/ra_syntax/test_data/lexer/0003_ident.txt | 14 ++++ crates/ra_syntax/test_data/lexer/0004_numbers.rs | 9 +++ crates/ra_syntax/test_data/lexer/0004_numbers.txt | 66 +++++++++++++++++++ crates/ra_syntax/test_data/lexer/0005_symbols.rs | 6 ++ crates/ra_syntax/test_data/lexer/0005_symbols.txt | 77 ++++++++++++++++++++++ crates/ra_syntax/test_data/lexer/0006_chars.rs | 1 + crates/ra_syntax/test_data/lexer/0006_chars.txt | 16 +++++ crates/ra_syntax/test_data/lexer/0007_lifetimes.rs | 1 + .../ra_syntax/test_data/lexer/0007_lifetimes.txt | 8 +++ .../ra_syntax/test_data/lexer/0008_byte_strings.rs | 3 + .../test_data/lexer/0008_byte_strings.txt | 22 +++++++ crates/ra_syntax/test_data/lexer/0009_strings.rs | 2 + crates/ra_syntax/test_data/lexer/0009_strings.txt | 8 +++ crates/ra_syntax/test_data/lexer/0010_comments.rs | 3 + crates/ra_syntax/test_data/lexer/0010_comments.txt | 6 ++ crates/ra_syntax/test_data/lexer/0011_keywords.rs | 3 + crates/ra_syntax/test_data/lexer/0011_keywords.txt | 64 ++++++++++++++++++ .../ra_syntax/test_data/lexer/0013_raw_strings.rs | 1 + .../ra_syntax/test_data/lexer/0013_raw_strings.txt | 2 + .../test_data/lexer/0014_unclosed_char.rs | 1 + .../test_data/lexer/0014_unclosed_char.txt | 1 + .../test_data/lexer/0015_unclosed_string.rs | 1 + .../test_data/lexer/0015_unclosed_string.txt | 1 + crates/ra_syntax/test_data/lexer/0016_raw_ident.rs | 1 + .../ra_syntax/test_data/lexer/0016_raw_ident.txt | 2 + 32 files changed, 351 insertions(+) create mode 100644 crates/ra_syntax/test_data/lexer/00012_block_comment.rs create mode 100644 crates/ra_syntax/test_data/lexer/00012_block_comment.txt create mode 100644 crates/ra_syntax/test_data/lexer/0001_hello.rs create mode 100644 crates/ra_syntax/test_data/lexer/0001_hello.txt create mode 100644 crates/ra_syntax/test_data/lexer/0002_whitespace.rs create mode 100644 crates/ra_syntax/test_data/lexer/0002_whitespace.txt create mode 100644 crates/ra_syntax/test_data/lexer/0003_ident.rs create mode 100644 crates/ra_syntax/test_data/lexer/0003_ident.txt create mode 100644 crates/ra_syntax/test_data/lexer/0004_numbers.rs create mode 100644 crates/ra_syntax/test_data/lexer/0004_numbers.txt create mode 100644 crates/ra_syntax/test_data/lexer/0005_symbols.rs create mode 100644 crates/ra_syntax/test_data/lexer/0005_symbols.txt create mode 100644 crates/ra_syntax/test_data/lexer/0006_chars.rs create mode 100644 crates/ra_syntax/test_data/lexer/0006_chars.txt create mode 100644 crates/ra_syntax/test_data/lexer/0007_lifetimes.rs create mode 100644 crates/ra_syntax/test_data/lexer/0007_lifetimes.txt create mode 100644 crates/ra_syntax/test_data/lexer/0008_byte_strings.rs create mode 100644 crates/ra_syntax/test_data/lexer/0008_byte_strings.txt create mode 100644 crates/ra_syntax/test_data/lexer/0009_strings.rs create mode 100644 crates/ra_syntax/test_data/lexer/0009_strings.txt create mode 100644 crates/ra_syntax/test_data/lexer/0010_comments.rs create mode 100644 crates/ra_syntax/test_data/lexer/0010_comments.txt create mode 100644 crates/ra_syntax/test_data/lexer/0011_keywords.rs create mode 100644 crates/ra_syntax/test_data/lexer/0011_keywords.txt create mode 100644 crates/ra_syntax/test_data/lexer/0013_raw_strings.rs create mode 100644 crates/ra_syntax/test_data/lexer/0013_raw_strings.txt create mode 100644 crates/ra_syntax/test_data/lexer/0014_unclosed_char.rs create mode 100644 crates/ra_syntax/test_data/lexer/0014_unclosed_char.txt create mode 100644 crates/ra_syntax/test_data/lexer/0015_unclosed_string.rs create mode 100644 crates/ra_syntax/test_data/lexer/0015_unclosed_string.txt create mode 100644 crates/ra_syntax/test_data/lexer/0016_raw_ident.rs create mode 100644 crates/ra_syntax/test_data/lexer/0016_raw_ident.txt (limited to 'crates/ra_syntax/test_data/lexer') diff --git a/crates/ra_syntax/test_data/lexer/00012_block_comment.rs b/crates/ra_syntax/test_data/lexer/00012_block_comment.rs new file mode 100644 index 000000000..708aac197 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/00012_block_comment.rs @@ -0,0 +1,4 @@ +/* */ +/**/ +/* /* */ */ +/* diff --git a/crates/ra_syntax/test_data/lexer/00012_block_comment.txt b/crates/ra_syntax/test_data/lexer/00012_block_comment.txt new file mode 100644 index 000000000..9958b2518 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/00012_block_comment.txt @@ -0,0 +1,7 @@ +COMMENT 5 "/* */" +WHITESPACE 1 "\n" +COMMENT 4 "/**/" +WHITESPACE 1 "\n" +COMMENT 11 "/* /* */ */" +WHITESPACE 1 "\n" +COMMENT 3 "/*\n" diff --git a/crates/ra_syntax/test_data/lexer/0001_hello.rs b/crates/ra_syntax/test_data/lexer/0001_hello.rs new file mode 100644 index 000000000..95d09f2b1 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0001_hello.rs @@ -0,0 +1 @@ +hello world \ No newline at end of file diff --git a/crates/ra_syntax/test_data/lexer/0001_hello.txt b/crates/ra_syntax/test_data/lexer/0001_hello.txt new file mode 100644 index 000000000..27a5940a9 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0001_hello.txt @@ -0,0 +1,3 @@ +IDENT 5 "hello" +WHITESPACE 1 " " +IDENT 5 "world" diff --git a/crates/ra_syntax/test_data/lexer/0002_whitespace.rs b/crates/ra_syntax/test_data/lexer/0002_whitespace.rs new file mode 100644 index 000000000..08fce1418 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0002_whitespace.rs @@ -0,0 +1,4 @@ +a b c +d + +e f diff --git a/crates/ra_syntax/test_data/lexer/0002_whitespace.txt b/crates/ra_syntax/test_data/lexer/0002_whitespace.txt new file mode 100644 index 000000000..01d260918 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0002_whitespace.txt @@ -0,0 +1,12 @@ +IDENT 1 "a" +WHITESPACE 1 " " +IDENT 1 "b" +WHITESPACE 2 " " +IDENT 1 "c" +WHITESPACE 1 "\n" +IDENT 1 "d" +WHITESPACE 2 "\n\n" +IDENT 1 "e" +WHITESPACE 1 "\t" +IDENT 1 "f" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0003_ident.rs b/crates/ra_syntax/test_data/lexer/0003_ident.rs new file mode 100644 index 000000000..c05c9c009 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0003_ident.rs @@ -0,0 +1 @@ +foo foo_ _foo _ __ x привет diff --git a/crates/ra_syntax/test_data/lexer/0003_ident.txt b/crates/ra_syntax/test_data/lexer/0003_ident.txt new file mode 100644 index 000000000..4a0d5c053 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0003_ident.txt @@ -0,0 +1,14 @@ +IDENT 3 "foo" +WHITESPACE 1 " " +IDENT 4 "foo_" +WHITESPACE 1 " " +IDENT 4 "_foo" +WHITESPACE 1 " " +UNDERSCORE 1 "_" +WHITESPACE 1 " " +IDENT 2 "__" +WHITESPACE 1 " " +IDENT 1 "x" +WHITESPACE 1 " " +IDENT 12 "привет" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0004_numbers.rs b/crates/ra_syntax/test_data/lexer/0004_numbers.rs new file mode 100644 index 000000000..dc974b553 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0004_numbers.rs @@ -0,0 +1,9 @@ +0 0b 0o 0x 00 0_ 0. 0e 0E 0z +01790 0b1790 0o1790 0x1790aAbBcCdDeEfF 001279 0_1279 0.1279 0e1279 0E1279 +0..2 +0.foo() +0e+1 +0.e+1 +0.0E-2 +0___0.10000____0000e+111__ +1i64 92.0f32 11__s \ No newline at end of file diff --git a/crates/ra_syntax/test_data/lexer/0004_numbers.txt b/crates/ra_syntax/test_data/lexer/0004_numbers.txt new file mode 100644 index 000000000..7bb89b8ae --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0004_numbers.txt @@ -0,0 +1,66 @@ +INT_NUMBER 1 "0" +WHITESPACE 1 " " +INT_NUMBER 2 "0b" +WHITESPACE 1 " " +INT_NUMBER 2 "0o" +WHITESPACE 1 " " +INT_NUMBER 2 "0x" +WHITESPACE 1 " " +INT_NUMBER 2 "00" +WHITESPACE 1 " " +INT_NUMBER 2 "0_" +WHITESPACE 1 " " +FLOAT_NUMBER 2 "0." +WHITESPACE 1 " " +FLOAT_NUMBER 2 "0e" +WHITESPACE 1 " " +FLOAT_NUMBER 2 "0E" +WHITESPACE 1 " " +INT_NUMBER 2 "0z" +WHITESPACE 1 "\n" +INT_NUMBER 5 "01790" +WHITESPACE 1 " " +INT_NUMBER 6 "0b1790" +WHITESPACE 1 " " +INT_NUMBER 6 "0o1790" +WHITESPACE 1 " " +INT_NUMBER 18 "0x1790aAbBcCdDeEfF" +WHITESPACE 1 " " +INT_NUMBER 6 "001279" +WHITESPACE 1 " " +INT_NUMBER 6 "0_1279" +WHITESPACE 1 " " +FLOAT_NUMBER 6 "0.1279" +WHITESPACE 1 " " +FLOAT_NUMBER 6 "0e1279" +WHITESPACE 1 " " +FLOAT_NUMBER 6 "0E1279" +WHITESPACE 1 "\n" +INT_NUMBER 1 "0" +DOT 1 "." +DOT 1 "." +INT_NUMBER 1 "2" +WHITESPACE 1 "\n" +INT_NUMBER 1 "0" +DOT 1 "." +IDENT 3 "foo" +L_PAREN 1 "(" +R_PAREN 1 ")" +WHITESPACE 1 "\n" +FLOAT_NUMBER 4 "0e+1" +WHITESPACE 1 "\n" +INT_NUMBER 1 "0" +DOT 1 "." +IDENT 1 "e" +PLUS 1 "+" +INT_NUMBER 1 "1" +WHITESPACE 1 "\n" +FLOAT_NUMBER 6 "0.0E-2" +WHITESPACE 1 "\n" +FLOAT_NUMBER 26 "0___0.10000____0000e+111__" +WHITESPACE 1 "\n" +INT_NUMBER 4 "1i64" +WHITESPACE 1 " " +FLOAT_NUMBER 7 "92.0f32" +WHITESPACE 1 " " +INT_NUMBER 5 "11__s" diff --git a/crates/ra_syntax/test_data/lexer/0005_symbols.rs b/crates/ra_syntax/test_data/lexer/0005_symbols.rs new file mode 100644 index 000000000..487569b5a --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0005_symbols.rs @@ -0,0 +1,6 @@ +; , ( ) { } [ ] < > @ # ~ ? $ & | + * / ^ % +. .. ... ..= +: :: += => +! != +- -> diff --git a/crates/ra_syntax/test_data/lexer/0005_symbols.txt b/crates/ra_syntax/test_data/lexer/0005_symbols.txt new file mode 100644 index 000000000..469a90e42 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0005_symbols.txt @@ -0,0 +1,77 @@ +SEMI 1 ";" +WHITESPACE 1 " " +COMMA 1 "," +WHITESPACE 1 " " +L_PAREN 1 "(" +WHITESPACE 1 " " +R_PAREN 1 ")" +WHITESPACE 1 " " +L_CURLY 1 "{" +WHITESPACE 1 " " +R_CURLY 1 "}" +WHITESPACE 1 " " +L_BRACK 1 "[" +WHITESPACE 1 " " +R_BRACK 1 "]" +WHITESPACE 1 " " +L_ANGLE 1 "<" +WHITESPACE 1 " " +R_ANGLE 1 ">" +WHITESPACE 1 " " +AT 1 "@" +WHITESPACE 1 " " +POUND 1 "#" +WHITESPACE 1 " " +TILDE 1 "~" +WHITESPACE 1 " " +QUESTION 1 "?" +WHITESPACE 1 " " +DOLLAR 1 "$" +WHITESPACE 1 " " +AMP 1 "&" +WHITESPACE 1 " " +PIPE 1 "|" +WHITESPACE 1 " " +PLUS 1 "+" +WHITESPACE 1 " " +STAR 1 "*" +WHITESPACE 1 " " +SLASH 1 "/" +WHITESPACE 1 " " +CARET 1 "^" +WHITESPACE 1 " " +PERCENT 1 "%" +WHITESPACE 1 "\n" +DOT 1 "." +WHITESPACE 1 " " +DOT 1 "." +DOT 1 "." +WHITESPACE 1 " " +DOT 1 "." +DOT 1 "." +DOT 1 "." +WHITESPACE 1 " " +DOT 1 "." +DOT 1 "." +EQ 1 "=" +WHITESPACE 1 "\n" +COLON 1 ":" +WHITESPACE 1 " " +COLON 1 ":" +COLON 1 ":" +WHITESPACE 1 "\n" +EQ 1 "=" +WHITESPACE 1 " " +EQ 1 "=" +R_ANGLE 1 ">" +WHITESPACE 1 "\n" +EXCL 1 "!" +WHITESPACE 1 " " +EXCL 1 "!" +EQ 1 "=" +WHITESPACE 1 "\n" +MINUS 1 "-" +WHITESPACE 1 " " +MINUS 1 "-" +R_ANGLE 1 ">" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0006_chars.rs b/crates/ra_syntax/test_data/lexer/0006_chars.rs new file mode 100644 index 000000000..454ee0a5f --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0006_chars.rs @@ -0,0 +1 @@ +'x' ' ' '0' 'hello' '\x7f' '\n' '\\' '\'' diff --git a/crates/ra_syntax/test_data/lexer/0006_chars.txt b/crates/ra_syntax/test_data/lexer/0006_chars.txt new file mode 100644 index 000000000..950954fbc --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0006_chars.txt @@ -0,0 +1,16 @@ +CHAR 3 "\'x\'" +WHITESPACE 1 " " +CHAR 3 "\' \'" +WHITESPACE 1 " " +CHAR 3 "\'0\'" +WHITESPACE 1 " " +CHAR 7 "\'hello\'" +WHITESPACE 1 " " +CHAR 6 "\'\\x7f\'" +WHITESPACE 1 " " +CHAR 4 "\'\\n\'" +WHITESPACE 1 " " +CHAR 4 "\'\\\\\'" +WHITESPACE 1 " " +CHAR 4 "\'\\\'\'" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0007_lifetimes.rs b/crates/ra_syntax/test_data/lexer/0007_lifetimes.rs new file mode 100644 index 000000000..b764f1dce --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0007_lifetimes.rs @@ -0,0 +1 @@ +'a 'foo 'foo_bar_baz '_ diff --git a/crates/ra_syntax/test_data/lexer/0007_lifetimes.txt b/crates/ra_syntax/test_data/lexer/0007_lifetimes.txt new file mode 100644 index 000000000..005c29100 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0007_lifetimes.txt @@ -0,0 +1,8 @@ +LIFETIME 2 "\'a" +WHITESPACE 1 " " +LIFETIME 4 "\'foo" +WHITESPACE 1 " " +LIFETIME 12 "\'foo_bar_baz" +WHITESPACE 1 " " +LIFETIME 2 "\'_" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0008_byte_strings.rs b/crates/ra_syntax/test_data/lexer/0008_byte_strings.rs new file mode 100644 index 000000000..b54930f5e --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0008_byte_strings.rs @@ -0,0 +1,3 @@ +b'' b'x' b"foo" br"" +b''suf b""ix br""br +b'\n' b'\\' b'\'' b'hello' diff --git a/crates/ra_syntax/test_data/lexer/0008_byte_strings.txt b/crates/ra_syntax/test_data/lexer/0008_byte_strings.txt new file mode 100644 index 000000000..bc03b51a8 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0008_byte_strings.txt @@ -0,0 +1,22 @@ +BYTE 3 "b\'\'" +WHITESPACE 1 " " +BYTE 4 "b\'x\'" +WHITESPACE 1 " " +BYTE_STRING 6 "b\"foo\"" +WHITESPACE 1 " " +RAW_BYTE_STRING 4 "br\"\"" +WHITESPACE 1 "\n" +BYTE 6 "b\'\'suf" +WHITESPACE 1 " " +BYTE_STRING 5 "b\"\"ix" +WHITESPACE 1 " " +RAW_BYTE_STRING 6 "br\"\"br" +WHITESPACE 1 "\n" +BYTE 5 "b\'\\n\'" +WHITESPACE 1 " " +BYTE 5 "b\'\\\\\'" +WHITESPACE 1 " " +BYTE 5 "b\'\\\'\'" +WHITESPACE 1 " " +BYTE 8 "b\'hello\'" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0009_strings.rs b/crates/ra_syntax/test_data/lexer/0009_strings.rs new file mode 100644 index 000000000..4ddb5bffc --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0009_strings.rs @@ -0,0 +1,2 @@ +"hello" r"world" "\n\"\\no escape" "multi +line" diff --git a/crates/ra_syntax/test_data/lexer/0009_strings.txt b/crates/ra_syntax/test_data/lexer/0009_strings.txt new file mode 100644 index 000000000..4cb4d711d --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0009_strings.txt @@ -0,0 +1,8 @@ +STRING 7 "\"hello\"" +WHITESPACE 1 " " +RAW_STRING 8 "r\"world\"" +WHITESPACE 1 " " +STRING 17 "\"\\n\\\"\\\\no escape\"" +WHITESPACE 1 " " +STRING 12 "\"multi\nline\"" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0010_comments.rs b/crates/ra_syntax/test_data/lexer/0010_comments.rs new file mode 100644 index 000000000..71bdd1f9c --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0010_comments.rs @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +// hello +//! World diff --git a/crates/ra_syntax/test_data/lexer/0010_comments.txt b/crates/ra_syntax/test_data/lexer/0010_comments.txt new file mode 100644 index 000000000..3c997de3f --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0010_comments.txt @@ -0,0 +1,6 @@ +SHEBANG 19 "#!/usr/bin/env bash" +WHITESPACE 1 "\n" +COMMENT 8 "// hello" +WHITESPACE 1 "\n" +COMMENT 9 "//! World" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0011_keywords.rs b/crates/ra_syntax/test_data/lexer/0011_keywords.rs new file mode 100644 index 000000000..1e91bff4e --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0011_keywords.rs @@ -0,0 +1,3 @@ +async fn use struct trait enum impl true false as extern crate +mod pub self super in where for loop while if match const +static mut type ref let else move return diff --git a/crates/ra_syntax/test_data/lexer/0011_keywords.txt b/crates/ra_syntax/test_data/lexer/0011_keywords.txt new file mode 100644 index 000000000..22c00eefb --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0011_keywords.txt @@ -0,0 +1,64 @@ +ASYNC_KW 5 "async" +WHITESPACE 1 " " +FN_KW 2 "fn" +WHITESPACE 1 " " +USE_KW 3 "use" +WHITESPACE 1 " " +STRUCT_KW 6 "struct" +WHITESPACE 1 " " +TRAIT_KW 5 "trait" +WHITESPACE 1 " " +ENUM_KW 4 "enum" +WHITESPACE 1 " " +IMPL_KW 4 "impl" +WHITESPACE 1 " " +TRUE_KW 4 "true" +WHITESPACE 1 " " +FALSE_KW 5 "false" +WHITESPACE 1 " " +AS_KW 2 "as" +WHITESPACE 1 " " +EXTERN_KW 6 "extern" +WHITESPACE 1 " " +CRATE_KW 5 "crate" +WHITESPACE 1 "\n" +MOD_KW 3 "mod" +WHITESPACE 1 " " +PUB_KW 3 "pub" +WHITESPACE 1 " " +SELF_KW 4 "self" +WHITESPACE 1 " " +SUPER_KW 5 "super" +WHITESPACE 1 " " +IN_KW 2 "in" +WHITESPACE 1 " " +WHERE_KW 5 "where" +WHITESPACE 1 " " +FOR_KW 3 "for" +WHITESPACE 1 " " +LOOP_KW 4 "loop" +WHITESPACE 1 " " +WHILE_KW 5 "while" +WHITESPACE 1 " " +IF_KW 2 "if" +WHITESPACE 1 " " +MATCH_KW 5 "match" +WHITESPACE 1 " " +CONST_KW 5 "const" +WHITESPACE 1 "\n" +STATIC_KW 6 "static" +WHITESPACE 1 " " +MUT_KW 3 "mut" +WHITESPACE 1 " " +TYPE_KW 4 "type" +WHITESPACE 1 " " +REF_KW 3 "ref" +WHITESPACE 1 " " +LET_KW 3 "let" +WHITESPACE 1 " " +ELSE_KW 4 "else" +WHITESPACE 1 " " +MOVE_KW 4 "move" +WHITESPACE 1 " " +RETURN_KW 6 "return" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0013_raw_strings.rs b/crates/ra_syntax/test_data/lexer/0013_raw_strings.rs new file mode 100644 index 000000000..e5ed0b693 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0013_raw_strings.rs @@ -0,0 +1 @@ +r###"this is a r##"raw"## string"### diff --git a/crates/ra_syntax/test_data/lexer/0013_raw_strings.txt b/crates/ra_syntax/test_data/lexer/0013_raw_strings.txt new file mode 100644 index 000000000..9cf0957d1 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0013_raw_strings.txt @@ -0,0 +1,2 @@ +RAW_STRING 36 "r###\"this is a r##\"raw\"## string\"###" +WHITESPACE 1 "\n" diff --git a/crates/ra_syntax/test_data/lexer/0014_unclosed_char.rs b/crates/ra_syntax/test_data/lexer/0014_unclosed_char.rs new file mode 100644 index 000000000..9c0007077 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0014_unclosed_char.rs @@ -0,0 +1 @@ +'1 \ No newline at end of file diff --git a/crates/ra_syntax/test_data/lexer/0014_unclosed_char.txt b/crates/ra_syntax/test_data/lexer/0014_unclosed_char.txt new file mode 100644 index 000000000..737a300ee --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0014_unclosed_char.txt @@ -0,0 +1 @@ +LIFETIME 2 "\'1" diff --git a/crates/ra_syntax/test_data/lexer/0015_unclosed_string.rs b/crates/ra_syntax/test_data/lexer/0015_unclosed_string.rs new file mode 100644 index 000000000..d771a26d4 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0015_unclosed_string.rs @@ -0,0 +1 @@ +"hello diff --git a/crates/ra_syntax/test_data/lexer/0015_unclosed_string.txt b/crates/ra_syntax/test_data/lexer/0015_unclosed_string.txt new file mode 100644 index 000000000..728c40b66 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0015_unclosed_string.txt @@ -0,0 +1 @@ +STRING 7 "\"hello\n" diff --git a/crates/ra_syntax/test_data/lexer/0016_raw_ident.rs b/crates/ra_syntax/test_data/lexer/0016_raw_ident.rs new file mode 100644 index 000000000..b40a1b6a2 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0016_raw_ident.rs @@ -0,0 +1 @@ +r#raw_ident diff --git a/crates/ra_syntax/test_data/lexer/0016_raw_ident.txt b/crates/ra_syntax/test_data/lexer/0016_raw_ident.txt new file mode 100644 index 000000000..484689693 --- /dev/null +++ b/crates/ra_syntax/test_data/lexer/0016_raw_ident.txt @@ -0,0 +1,2 @@ +IDENT 11 "r#raw_ident" +WHITESPACE 1 "\n" -- cgit v1.2.3