forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvalItemOffset.test
More file actions
64 lines (43 loc) · 1.65 KB
/
EvalItemOffset.test
File metadata and controls
64 lines (43 loc) · 1.65 KB
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
setup "default item delim"
test itemOffset("g", "abc, def, ghi") is 3
test itemOffset(" def", "abc, def, ghi") is 2
test itemOffset("x", "abc, def, ghi") is 0
test itemOffset("ABC", "abc, def, ghi") is 1
test itemOffset("abc", "1,2,abc,4,5,abc", 1) is 2
test itemOffset("abc", "1,2,abc,4,5,abc", 3) is 3
test itemOffset("abc", "1,2,abc,4,5,abc", 6) is 0
set the wholematches to true
test itemOffset("g", "abc, def, ghi") is 0
test itemOffset(" ghi", "abc, def, ghi") is 3
set the wholematches to false
set the caseSensitive to true
test itemOffset("ab", "abc, def, ghi") is 1
test itemOffset("AB", "abc, def, ghi") is 0
set the wholematches to true
test itemOffset("ab", "abc, def, ghi") is 0
test itemOffset("AB", "abc, def, ghi") is 0
test itemOffset("abc", "abc, def, ghi") is 1
test itemOffset("ABC", "abc, def, ghi") is 0
teardown
setup "custom item delim"
set the itemdel to "|"
test itemOffset("g", "abc|def|ghi") is 3
test itemOffset("def", "abc|def|ghi") is 2
test itemOffset("x", "abc|def|ghi") is 0
test itemOffset("ABC", "abc|def|ghi") is 1
test itemOffset("abc", "1|2|abc|4|5|abc", 1) is 2
test itemOffset("abc", "1|2|abc|4|5|abc", 3) is 3
test itemOffset("abc", "1|2|abc|4|5|abc", 6) is 0
set the wholematches to true
test itemOffset("g", "abc|def|ghi") is 0
test itemOffset("ghi", "abc|def|ghi") is 3
set the wholematches to false
set the caseSensitive to true
test itemOffset("ab", "abc|def|ghi") is 1
test itemOffset("AB", "abc|def|ghi") is 0
set the wholematches to true
test itemOffset("ab", "abc|def|ghi") is 0
test itemOffset("AB", "abc|def|ghi") is 0
test itemOffset("abc", "abc|def|ghi") is 1
test itemOffset("ABC", "abc|def|ghi") is 0
teardown