This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathliterals.lcb
More file actions
53 lines (38 loc) · 1.63 KB
/
literals.lcb
File metadata and controls
53 lines (38 loc) · 1.63 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
/*
Copyright (C) 2015 LiveCode Ltd.
This file is part of LiveCode.
LiveCode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License v3 as published by the Free
Software Foundation.
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
module com.livecode.compiler.literals.tests
public handler TestLiteralNul()
variable tString
test "single literal nul" when the number of chars in "\u{0}" is 1
put "a\u{0}b\u{0}c" into tString
test diagnostic "literal nuls: actual string length is" && \
the number of chars in tString formatted as string
test "literal nuls" when the number of chars in tString is 5
end handler
public handler TestLiteralList()
test "empty list constant" when the number of elements in [] is 0
test "non-empty list constant" when the number of elements in [1] is 1
variable tValue
put "bar" into tValue
test "non-empty list expression" when the number of elements in [tValue] is 1
end handler
public handler TestLiteralArray()
test "empty array constant" when the number of elements in {} is 0
test "non-empty array constant" when the number of elements in {"foo": 1} is 1
variable tKey
put "foo" into tKey
variable tValue
put {} into tValue
test "non-empty array expression" when the number of elements in {tKey: tValue} is 1
end handler
end module