-
Notifications
You must be signed in to change notification settings - Fork 540
/
Copy pathparameters.rs
52 lines (49 loc) · 889 Bytes
/
parameters.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
use super::*;
#[test]
fn parameter_default_values_may_use_earlier_parameters() {
Test::new()
.justfile(
"
@foo a b=a:
echo {{ b }}
",
)
.args(["foo", "bar"])
.stdout("bar\n")
.run();
}
#[test]
fn parameter_default_values_may_not_use_later_parameters() {
Test::new()
.justfile(
"
@foo a b=c c='':
echo {{ b }}
",
)
.args(["foo", "bar"])
.stderr(
"
error: Variable `c` not defined
——▶ justfile:1:10
│
1 │ @foo a b=c c='':
│ ^
",
)
.status(EXIT_FAILURE)
.run();
}
#[test]
fn star_may_follow_default() {
Test::new()
.justfile(
"
foo bar='baz' *bob:
@echo {{bar}} {{bob}}
",
)
.args(["foo", "hello", "goodbye"])
.stdout("hello goodbye\n")
.run();
}