forked from ordinals/ord
-
Notifications
You must be signed in to change notification settings - Fork 21
/
name.rs
52 lines (46 loc) Β· 886 Bytes
/
name.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 empty() -> Result {
Test::new()?
.args(&["name", ""])
.expected_stderr("error: Invalid name\n")
.expected_status(1)
.run()
}
#[test]
fn a() -> Result {
Test::new()?
.args(&["name", "a"])
.expected_stdout("2099999997689999\n")
.run()
}
#[test]
fn b() -> Result {
Test::new()?
.args(&["name", "b"])
.expected_stdout("2099999997689998\n")
.run()
}
#[test]
fn end_of_range() -> Result {
Test::new()?
.args(&["name", "nvtdijuwxlp"])
.expected_stdout("0\n")
.run()
}
#[test]
fn out_of_range() -> Result {
Test::new()?
.args(&["name", "nvtdijuwxlr"])
.expected_stderr("error: Name out of range\n")
.expected_status(1)
.run()
}
#[test]
fn invalid() -> Result {
Test::new()?
.args(&["name", "0"])
.expected_stderr("error: Invalid name\n")
.expected_status(1)
.run()
}