forked from adoyle-h/lobash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstr_include.s.bats
62 lines (52 loc) · 1.14 KB
/
str_include.s.bats
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
#!/usr/bin/env bats
setup_fixture
test_prepare str_include.s
load_module str_include.s
@test "l.str_include.s hello he" {
run l.str_include.s hello he
assert_success
assert_output true
}
@test "l.str_include.s hello ''" {
run l.str_include.s hello ''
assert_success
assert_output true
local s=''
run l.str_include.s hello "$s"
assert_success
assert_output true
}
@test "l.str_include.s hello ' he'" {
run l.str_include.s hello ' he'
assert_success
assert_output false
}
@test "l.str_include.s hello 'o '" {
run l.str_include.s hello 'o '
assert_success
assert_output false
}
@test "l.str_include.s 'hello world' ' '" {
run l.str_include.s 'hello world' ' '
assert_success
assert_output true
}
@test "l.str_include.s 'hello world' 'lo w'" {
run l.str_include.s 'hello world' 'lo w'
assert_success
assert_output true
}
@test "l.str_include.s 'hell\$o world' '$'" {
t() {
# shellcheck disable=2016
l.str_include.s 'hell$o world' '$'
}
run t
assert_success
assert_output true
}
@test "l.str_include.s '[hello world' '['" {
run l.str_include.s '[hello world' '['
assert_success
assert_output true
}