blob: 442bfc780b5a8568834e3ed661149b1046d28ee9 (
plain)
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
|
# file : tests/expansion/type.testscript
# license : MIT; see accompanying LICENSE file
# Test type propagation during expansion.
.include ../common.testscript
: var
:
$* <<EOI
x = [bool] true
y = $x
assert ($type($y) == bool)
EOI
: eval
:
$* <<EOI
y = ([bool] true)
assert ($type($y) == bool)
EOI
: func
:
$* <<EOI
y = $identity([bool] true)
assert ($type($y) == bool)
EOI
: untypify
:
$* <<EOI
x = [bool] true
y = "$x"
assert ($type($y) == "")
EOI
: retypify
:
$* <'print [bool] ([string] true)' >'true'
: retypify-quote
:
$* <'print [bool] "([string] true)"' >'true'
: retypify-name
: Test the "steal" case of untypify()
:
$* <'print [bool] "([name] true)"' >'true'
|