u6a/tests/default/dump.exp

43 lines
1.3 KiB
Plaintext

#
# Copyright (C) 2020 CismonX <admin@cismon.net>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty, provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
#
set tool "default"
set timeout 1
set expected ".text
00000000: APP s, i
00000001: APP acc, i
00000002: SA 0x0000000e
00000003: APP s, i
00000004: SA 0x0000000d
00000005: DEL 0x00000009
00000006: LC<print> 0x00000000
00000007: APP acc, .U
00000008: LA
00000009: APP k, acc
0000000a: APP s, acc
0000000b: APP acc, i
0000000c: LA
0000000d: LA
0000000e: APP e, acc
.rodata
00000000: 6e6c 616d 6264 612c 2063 2765 7374 2074 nlambda, c'est t
00000010: 7269 7669 616c 210a 00 rivial!.."
# Code taken from ftp://ftp.madore.org/pub/madore/unlambda/CUAN/trivial.unl
# Written by David Madore <david.madore@ens.fr>
set src_code "```sii``si``s`k`d`r`.!`.l`.a`.i`.v`.i`.r`.t`. `.t`.s`.e`.'`.c`. `.,`.a`.d`.b`.m`.a`.l`.n.Ui"
set result [ u6a_dump_mnemonics $src_code ]
if { $result eq $expected } {
pass "ok!"
} else {
fail "fail! got: $result"
}