aboutsummaryrefslogtreecommitdiff
path: root/tests/expansion/type.test
blob: 8899aa37d23fa45a2387b7f996a8e9ec6447829e (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.test
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

# Test type propagation during expansion.

.include ../common.test

: 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'