blob: 12204a3504716e5e054a67b985ce7f9a66e40c80 (
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
50
|
# file : tests/expansion/type.testscript
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# 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'
|