Skip to content

Commit 7a85dd3

Browse files
committed
separate let/const/unlet/lockvar/unlockvar tests
1 parent 847601a commit 7a85dd3

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

test/test1.ok

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@
1414
(echo a b c))
1515
(delfunction s:foo)
1616
(call (s:foo 1 2 3))
17-
(let = a (dict ("x" "y")))
18-
(let = (a b . c) (list 1 2 3))
19-
(let += (a b . c) (list 1 2 3))
20-
(let -= (a b . c) (list 1 2 3))
21-
(let .= (a b . c) (list 1 2 3))
22-
(let = (dot (dot foo bar) baz) 123)
23-
(let = (subscript (subscript foo (bar)) (baz)) 456)
24-
(let = (dot (subscript foo (bar)) baz) 789)
25-
(let = (slice foo 1 2) (list 3 4))
26-
(unlet a b c)
27-
(lockvar a b c)
28-
(lockvar 1 a b c)
29-
(unlockvar a b c)
30-
(unlockvar 1 a b c)
3117
(try
3218
(throw "err")
3319
catch /err/
@@ -46,14 +32,4 @@
4632
(echo (subscript x 0) (subscript x y))
4733
(echo (slice x 1 2) (slice x 1 nil) (slice x nil 2) (slice x nil nil))
4834
(echo (dot x y) (dot (dot x y) z))
49-
(let = a 1)
50-
(let += a 2)
51-
(let *= a 3)
52-
(let /= a 4)
53-
(let %= a 5)
54-
(let ..= a 'foo')
5535
(echo (concat (concat 'foo' 'bar') 'baz'))
56-
(let = a '🐥')
57-
(const = a 1)
58-
(const = (a b) (list 1 2))
59-
(const = (a b . c) (list 1 2 3))

test/test1.vim

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,6 @@ for [a, b; c] in d
1818
endfor
1919
delfunction s:foo
2020
call s:foo(1, 2, 3)
21-
let a = {"x": "y"}
22-
let [a, b; c] = [1, 2, 3]
23-
let [a, b; c] += [1, 2, 3]
24-
let [a, b; c] -= [1, 2, 3]
25-
let [a, b; c] .= [1, 2, 3]
26-
let foo.bar.baz = 123
27-
let foo[bar()][baz()] = 456
28-
let foo[bar()].baz = 789
29-
let foo[1:2] = [3, 4]
30-
unlet a b c
31-
lockvar a b c
32-
lockvar 1 a b c
33-
unlockvar a b c
34-
unlockvar 1 a b c
3521
try
3622
throw "err"
3723
catch /err/
@@ -51,14 +37,4 @@ echo {} {"x":"y"} {"x":"y","z":"w",}
5137
echo x[0] x[y]
5238
echo x[1:2] x[1:] x[:2] x[:]
5339
echo x.y x.y.z
54-
let a = 1
55-
let a += 2
56-
let a *= 3
57-
let a /= 4
58-
let a %= 5
59-
let a ..= 'foo'
6040
echo ('foo' .. 'bar')..'baz'
61-
let a = '🐥'
62-
const a = 1
63-
const [a, b] = [1, 2]
64-
const [a, b; c] = [1, 2, 3]

test/test_letconst.ok

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(let = a (dict ("x" "y")))
2+
(let = (a b . c) (list 1 2 3))
3+
(let += (a b . c) (list 1 2 3))
4+
(let -= (a b . c) (list 1 2 3))
5+
(let .= (a b . c) (list 1 2 3))
6+
(let = (dot (dot foo bar) baz) 123)
7+
(let = (subscript (subscript foo (bar)) (baz)) 456)
8+
(let = (dot (subscript foo (bar)) baz) 789)
9+
(let = (slice foo 1 2) (list 3 4))
10+
(unlet a b c)
11+
(lockvar a b c)
12+
(lockvar 1 a b c)
13+
(unlockvar a b c)
14+
(unlockvar 1 a b c)
15+
(let = a 1)
16+
(let += a 2)
17+
(let *= a 3)
18+
(let /= a 4)
19+
(let %= a 5)
20+
(let ..= a 'foo')
21+
(let = a '🐥')
22+
(const = a 1)
23+
(const = (a b) (list 1 2))
24+
(const = (a b . c) (list 1 2 3))

test/test_letconst.vim

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
let a = {"x": "y"}
2+
let [a, b; c] = [1, 2, 3]
3+
let [a, b; c] += [1, 2, 3]
4+
let [a, b; c] -= [1, 2, 3]
5+
let [a, b; c] .= [1, 2, 3]
6+
let foo.bar.baz = 123
7+
let foo[bar()][baz()] = 456
8+
let foo[bar()].baz = 789
9+
let foo[1:2] = [3, 4]
10+
unlet a b c
11+
lockvar a b c
12+
lockvar 1 a b c
13+
unlockvar a b c
14+
unlockvar 1 a b c
15+
let a = 1
16+
let a += 2
17+
let a *= 3
18+
let a /= 4
19+
let a %= 5
20+
let a ..= 'foo'
21+
let a = '🐥'
22+
const a = 1
23+
const [a, b] = [1, 2]
24+
const [a, b; c] = [1, 2, 3]

0 commit comments

Comments
 (0)