aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/validation/byte_string.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
committerAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
commit12e3b4c70b5ef23b2fdfc197296d483680e125f9 (patch)
tree71baa0e0a62f9f6b61450501c5f821f67badf9e4 /crates/ra_syntax/src/validation/byte_string.rs
parent5cb1d41a30d25cbe136402644bf5434dd667f1e5 (diff)
reformat the world
Diffstat (limited to 'crates/ra_syntax/src/validation/byte_string.rs')
-rw-r--r--crates/ra_syntax/src/validation/byte_string.rs20
1 files changed, 3 insertions, 17 deletions
diff --git a/crates/ra_syntax/src/validation/byte_string.rs b/crates/ra_syntax/src/validation/byte_string.rs
index bdb147545..7abe8f330 100644
--- a/crates/ra_syntax/src/validation/byte_string.rs
+++ b/crates/ra_syntax/src/validation/byte_string.rs
@@ -34,10 +34,7 @@ pub(crate) fn validate_byte_string_node(node: &ast::ByteString, errors: &mut Vec
34 } 34 }
35 35
36 if let Some(range) = components.suffix { 36 if let Some(range) = components.suffix {
37 errors.push(SyntaxError::new( 37 errors.push(SyntaxError::new(InvalidSuffix, range + literal_range.start()));
38 InvalidSuffix,
39 range + literal_range.start(),
40 ));
41 } 38 }
42} 39}
43 40
@@ -53,12 +50,7 @@ mod test {
53 50
54 fn assert_valid_str(literal: &str) { 51 fn assert_valid_str(literal: &str) {
55 let file = build_file(literal); 52 let file = build_file(literal);
56 assert!( 53 assert!(file.errors().len() == 0, "Errors for literal '{}': {:?}", literal, file.errors());
57 file.errors().len() == 0,
58 "Errors for literal '{}': {:?}",
59 literal,
60 file.errors()
61 );
62 } 54 }
63 55
64 fn assert_invalid_str(literal: &str) { 56 fn assert_invalid_str(literal: &str) {
@@ -130,13 +122,7 @@ mod test {
130 122
131 #[test] 123 #[test]
132 fn test_invalid_unicode_escape() { 124 fn test_invalid_unicode_escape() {
133 let well_formed = [ 125 let well_formed = [r"\u{FF}", r"\u{0}", r"\u{F}", r"\u{10FFFF}", r"\u{1_0__FF___FF_____}"];
134 r"\u{FF}",
135 r"\u{0}",
136 r"\u{F}",
137 r"\u{10FFFF}",
138 r"\u{1_0__FF___FF_____}",
139 ];
140 for c in &well_formed { 126 for c in &well_formed {
141 assert_invalid_str(c); 127 assert_invalid_str(c);
142 } 128 }