-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_inputs.rs
66 lines (62 loc) · 1.08 KB
/
sample_inputs.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
55
56
57
58
59
60
61
62
63
64
65
66
extern crate cli_test_dir;
use cli_test_dir::*;
const BIN: &'static str = "./main";
#[test]
fn sample1() {
let testdir = TestDir::new(BIN, "");
let output = testdir
.cmd()
.output_with_stdin(
r#"2
3 1 2
6 1 1
"#,
)
.tee_output()
.expect_success();
assert_eq!(
output.stdout_str(),
r#"Yes
"#
);
assert!(output.stderr_str().is_empty());
}
#[test]
fn sample2() {
let testdir = TestDir::new(BIN, "");
let output = testdir
.cmd()
.output_with_stdin(
r#"1
2 100 100
"#,
)
.tee_output()
.expect_success();
assert_eq!(
output.stdout_str(),
r#"No
"#
);
assert!(output.stderr_str().is_empty());
}
#[test]
fn sample3() {
let testdir = TestDir::new(BIN, "");
let output = testdir
.cmd()
.output_with_stdin(
r#"2
5 1 1
100 1 1
"#,
)
.tee_output()
.expect_success();
assert_eq!(
output.stdout_str(),
r#"No
"#
);
assert!(output.stderr_str().is_empty());
}