aboutsummaryrefslogtreecommitdiff
path: root/tests/function/builtin
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-22 11:30:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-09-22 11:52:39 +0200
commit7b9c113d52bbcecf45c9407e4ee30ee559418cb2 (patch)
treed3a63b9c8723e18a5586a8cb41a0eaf2a7fcac44 /tests/function/builtin
parent4accc73d03dfa223db2e373475a1cdf9fea6d38b (diff)
Add support for hex notation for uint64 type
Specifically, now we can do: x = [uint64] 0x0000ffff cxx.poptions += "-DOFFSET=$x" # -DOFFSET=65535 cxx.poptions += "-DOFFSET=$string($x, 16)" # -DOFFSET=0xffff cxx.poptions += "-DOFFSET=$string($x, 16, 8)" # -DOFFSET=0x0000ffff Note that there is no hex notation support for the int64 (signed) type.
Diffstat (limited to 'tests/function/builtin')
-rw-r--r--tests/function/builtin/testscript8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/function/builtin/testscript b/tests/function/builtin/testscript
index 00d594b..02c73ee 100644
--- a/tests/function/builtin/testscript
+++ b/tests/function/builtin/testscript
@@ -77,6 +77,14 @@
$* <'print $type($identity(abc))' >'' : untyped
}
+: string
+:
+{
+ $* <'print $string([uint64] 0xffff)' >'65535' : uint
+ $* <'print $string([uint64] 0xffff, 16)' >'0xffff' : uint-hex
+ $* <'print $string([uint64] 0xffff, 16, 8)' >'0x0000ffff' : uint-hex-width
+}
+
: sort
:
{