-
Notifications
You must be signed in to change notification settings - Fork 499
/
byte_order_mark.rs
54 lines (51 loc) · 949 Bytes
/
byte_order_mark.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use super::*;
#[test]
fn ignore_leading_byte_order_mark() {
Test::new()
.justfile(
"
\u{feff}foo:
echo bar
",
)
.stderr("echo bar\n")
.stdout("bar\n")
.run();
}
#[test]
fn non_leading_byte_order_mark_produces_error() {
Test::new()
.justfile(
"
foo:
echo bar
\u{feff}
",
)
.stderr(
"
error: Expected \'@\', \'[\', comment, end of file, end of line, or identifier, but found byte order mark
——▶ justfile:3:1
│
3 │ \u{feff}
│ ^
")
.status(EXIT_FAILURE)
.run();
}
#[test]
fn dont_mention_byte_order_mark_in_errors() {
Test::new()
.justfile("{")
.stderr(
"
error: Expected '@', '[', comment, end of file, end of line, or identifier, but found '{'
——▶ justfile:1:1
│
1 │ {
│ ^
",
)
.status(EXIT_FAILURE)
.run();
}