Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
add messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Sep 5, 2009
1 parent d8dc591 commit d7bf31c
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 92 deletions.
8 changes: 4 additions & 4 deletions t/pmc/boolean.t
Expand Up @@ -31,15 +31,15 @@ Tests C<LuaBoolean> PMC
.sub 'check_inheritance'
$P0 = new 'LuaBoolean'
$I0 = isa $P0, 'LuaAny'
is($I0, 1)
is($I0, 1, "check inheritance")
$I0 = isa $P0, 'LuaBoolean'
is($I0, 1)
.end

.sub 'check_interface'
$P0 = new 'LuaBoolean'
$I0 = does $P0, 'scalar'
is($I0, 1)
is($I0, 1, "check interface")
$I0 = does $P0, 'boolean'
is($I0, 1)
$I0 = does $P0, 'integer'
Expand All @@ -51,14 +51,14 @@ Tests C<LuaBoolean> PMC
.sub 'check_name'
$P0 = new 'LuaBoolean'
$S0 = typeof $P0
is($S0, 'boolean')
is($S0, 'boolean', "check name")
.end

.sub 'check_get_string'
$P0 = new 'LuaBoolean'
set $P0, 0
$S0 = $P0
is($S0, 'false')
is($S0, 'false', "check get_string")
set $P0, 1
$S0 = $P0
is($S0, 'true')
Expand Down
8 changes: 4 additions & 4 deletions t/pmc/boolean_hll.t
Expand Up @@ -33,15 +33,15 @@ Tests C<LuaBoolean> PMC
$P0 = new 'LuaBoolean'
set $P0, 1
$S0 = $P0
is($S0, 'true')
is($S0, 'true', "check HLL")
$I0 = isa $P0, 'LuaBoolean'
is($I0, 1)
.end

.sub 'check_HLL_const'
.const 'LuaBoolean' K = '1'
$S0 = K
is($S0, 'true')
is($S0, 'true', "check HLL & .const")
$I0 = isa K, 'LuaBoolean'
is($I0, 1)
.end
Expand All @@ -50,7 +50,7 @@ Tests C<LuaBoolean> PMC
$P0 = new 'LuaBoolean'
set $P0, 1
$S0 = $P0
is($S0, 'true')
is($S0, 'true', "check tostring")
$P1 = $P0.'tostring'()
$S0 = $P1
is($S0, 'true')
Expand All @@ -62,7 +62,7 @@ Tests C<LuaBoolean> PMC
$P0 = new 'LuaBoolean'
set $P0, 1
$S0 = $P0
is($S0, 'true')
is($S0, 'true', "check tonumber")
$P1 = $P0.'tonumber'()
$S0 = $P1
is($S0, 'nil')
Expand Down
12 changes: 6 additions & 6 deletions t/pmc/function.t
Expand Up @@ -33,7 +33,7 @@ Tests C<LuaFunction> PMC
.sub 'check_inheritance'
$P0 = new 'LuaFunction'
$I0 = isa $P0, 'scalar'
is($I0, 0)
is($I0, 0, "check inheritance")
$I0 = isa $P0, 'Sub'
is($I0, 1)
$I0 = isa $P0, 'Closure'
Expand All @@ -47,7 +47,7 @@ Tests C<LuaFunction> PMC
.sub 'check_interface'
$P0 = new 'LuaFunction'
$I0 = does $P0, 'scalar'
is($I0, 1)
is($I0, 1, "check interface")
$I0 = does $P0, 'sub'
is($I0, 1)
$I0 = does $P0, 'no_interface'
Expand All @@ -57,13 +57,13 @@ Tests C<LuaFunction> PMC
.sub 'check_name'
$P0 = new 'LuaFunction'
$S0 = typeof $P0
is($S0, 'function')
is($S0, 'function', "check name")
.end

.sub 'check_get_string'
$P0 = new 'LuaFunction'
$S0 = $P0
like($S0, '^function: <[0..9A..Fa..f]>*')
like($S0, '^function: <[0..9A..Fa..f]>*', "check get_string")
.end

.sub 'check_get_bool'
Expand All @@ -72,7 +72,7 @@ Tests C<LuaFunction> PMC
is($I0, 1)
.const 'Sub' F1 = 'f1'
$I0 = istrue F1
is($I0, 1)
is($I0, 1, "check get_bool")
.end

.sub f1
Expand All @@ -84,7 +84,7 @@ Tests C<LuaFunction> PMC
$P0 = new 'LuaFunction'
$P1 = not $P0
$S0 = $P1
is($S0, 'false')
is($S0, 'false', "check logical_not")
$S0 = typeof $P1
is($S0, 'boolean')
.end
Expand Down
14 changes: 7 additions & 7 deletions t/pmc/function_hll.t
Expand Up @@ -36,7 +36,7 @@ Tests C<LuaFunction> PMC
# .const 'LuaFunction' F1 = 'f1'
.const 'Sub' F1 = 'f1'
$I0 = isa F1, 'LuaFunction'
is($I0, 1)
is($I0, 1, "check HLL")
$S0 = F1()
is($S0, "f1()")
.const 'Sub' F2 = 'f2'
Expand All @@ -57,7 +57,7 @@ Tests C<LuaFunction> PMC
.sub 'check_HLL_autoboxing'
$P0 = fct1()
$I0 = isa $P0, 'LuaFunction'
is($I0, 1)
is($I0, 1, "check HLL autoboxing")
$P0 = fct2()
$I0 = isa $P0, 'LuaFunction'
is($I0, 1)
Expand All @@ -76,7 +76,7 @@ Tests C<LuaFunction> PMC
.sub 'check_tostring'
$P0 = new 'LuaFunction'
$S0 = $P0
like($S0, '^function: <[0..9A..Fa..f]>*')
like($S0, '^function: <[0..9A..Fa..f]>*', "check tostring")
$P1 = $P0.'tostring'()
$S0 = $P1
like($S0, '^function: <[0..9A..Fa..f]>*')
Expand All @@ -88,7 +88,7 @@ Tests C<LuaFunction> PMC
$P0 = new 'LuaFunction'
$P1 = $P0.'tonumber'()
$S0 = $P1
is($S0, 'nil')
is($S0, 'nil', "check tonumber")
$S0 = typeof $P1
is($S0, 'nil')
.end
Expand All @@ -97,7 +97,7 @@ Tests C<LuaFunction> PMC
.const 'Sub'F1 = 'f1'
$P0 = new 'LuaFunction', F1
$I0 = isa $P0, 'LuaFunction'
is($I0, 1)
is($I0, 1, "check init_pmc")
$S0 = $P0()
is($S0, "f1()")
.end
Expand All @@ -111,7 +111,7 @@ Tests C<LuaFunction> PMC
.const 'LuaString' k_print = 'print'
$P2 = $P1[k_print]
$I0 = isa $P2, 'LuaFunction'
is($I0, 1)
is($I0, 1, "load from pbc")
# $P2($P2)
.end

Expand All @@ -122,7 +122,7 @@ Tests C<LuaFunction> PMC
.const 'LuaString' k_print = 'print'
$P2 = $P1[k_print]
$I0 = isa $P2, 'LuaFunction'
is($I0, 1)
is($I0, 1, "load from pbc")
# $P2($P2)
.end

Expand Down
12 changes: 6 additions & 6 deletions t/pmc/nil.t
Expand Up @@ -33,42 +33,42 @@ Tests C<LuaNil> PMC
.sub 'check_inheritance'
$P0 = new 'LuaNil'
$I0 = isa $P0, 'LuaAny'
is($I0, 1)
is($I0, 1, "check inheritance")
$I0 = isa $P0, 'LuaNil'
is($I0, 1)
.end

.sub 'check_interface'
$P0 = new 'LuaNil'
$I0 = does $P0, 'scalar'
is($I0, 1)
is($I0, 1, "check interface")
$I0 = does $P0, 'no_interface'
is($I0, 0)
.end

.sub 'check_name'
$P0 = new 'LuaNil'
$S0 = typeof $P0
is($S0, 'nil')
is($S0, 'nil', "check name")
.end

.sub 'check_get_string'
$P0 = new 'LuaNil'
$S0 = $P0
is($S0, 'nil')
is($S0, 'nil', "check get_string")
.end

.sub 'check_get_bool'
$P0 = new 'LuaNil'
$I0 = isfalse $P0
is($I0, 1)
is($I0, 1, "check get_bool")
.end

.sub 'check_logical_not'
$P0 = new 'LuaNil'
$P1 = not $P0
$S0 = $P1
is($S0, 'true')
is($S0, 'true', "check logical_not")
$S0 = typeof $P1
is($S0, 'boolean')
.end
Expand Down
8 changes: 4 additions & 4 deletions t/pmc/nil_hll.t
Expand Up @@ -32,23 +32,23 @@ Tests C<LuaNil> PMC
.sub 'check_HLL'
$P0 = new 'LuaNil'
$S0 = $P0
is($S0, 'nil')
is($S0, 'nil', "check HLL")
$I0 = isa $P0, 'LuaNil'
is($I0, 1)
.end

.sub 'check_HLL_const'
.const 'LuaNil' K = 'dummy'
$S0 = K
is($S0, 'nil')
is($S0, 'nil', "check HLL & .const")
$I0 = isa K, 'LuaNil'
is($I0, 1)
.end

.sub 'check_tostring'
$P0 = new 'LuaNil'
$S0 = $P0
is($S0, 'nil')
is($S0, 'nil', "check tostring")
$P1 = $P0.'tostring'()
$S0 = $P1
is($S0, 'nil')
Expand All @@ -59,7 +59,7 @@ Tests C<LuaNil> PMC
.sub 'check_tonumber'
$P0 = new 'LuaNil'
$S0 = $P0
is($S0, 'nil')
is($S0, 'nil', "check tonumber")
$P1 = $P0.'tonumber'()
$S0 = $P1
is($S0, 'nil')
Expand Down
10 changes: 5 additions & 5 deletions t/pmc/number.t
Expand Up @@ -32,15 +32,15 @@ Tests C<LuaNumber> PMC
.sub 'check_inheritance'
$P0 = new 'LuaNumber'
$I0 = isa $P0, 'LuaAny'
is($I0, 1)
is($I0, 1, "check inheritance")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
.end

.sub 'check_interface'
$P0 = new 'LuaNumber'
$I0 = does $P0, 'scalar'
is($I0, 1)
is($I0, 1, "check interface")
$I0 = does $P0, 'float'
is($I0, 1)
$I0 = does $P0, 'no_interface'
Expand All @@ -50,14 +50,14 @@ Tests C<LuaNumber> PMC
.sub 'check_name'
$P0 = new 'LuaNumber'
$S0 = typeof $P0
is($S0, 'number')
is($S0, 'number', "check name")
.end

.sub 'check_set_integer_native'
$P0 = new 'LuaNumber'
set $P0, 3.14
$S0 = typeof $P0
is($S0, 'number')
is($S0, 'number', "check set_integer_native")
$S0 = $P0
is($S0, '3.14')
set $P0, 2
Expand All @@ -72,7 +72,7 @@ Tests C<LuaNumber> PMC
set $P0, 3.14
$P1 = not $P0
$S0 = $P1
is($S0, 'false')
is($S0, 'false', "check logical_not")
$S0 = typeof $P1
is($S0, 'boolean')
.end
Expand Down
14 changes: 7 additions & 7 deletions t/pmc/number_hll.t
Expand Up @@ -36,15 +36,15 @@ Tests C<LuaNumber> PMC
$P0 = new 'LuaNumber'
set $P0, 3.14
$S0 = $P0
is($S0, '3.14')
is($S0, '3.14', "check HLL")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
.end

.sub 'check_HLL_autoboxing'
$P0 = fct()
$S0 = $P0
is($S0, '3.14')
is($S0, '3.14', "check HLL autoboxing")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
.end
Expand All @@ -56,23 +56,23 @@ Tests C<LuaNumber> PMC
.sub 'check_HLL_const'
.const 'LuaNumber' K = '3.14'
$S0 = K
is($S0, '3.14')
is($S0, '3.14', "check HLL & .const")
$I0 = isa K, 'LuaNumber'
is($I0, 1)
.end

.sub 'check_box_float'
$P0 = box 3.14
$S0 = $P0
is($S0, '3.14')
is($S0, '3.14', "check box float")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
.end

.sub 'check_box_integer'
$P0 = box -2
$S0 = $P0
is($S0, '-2')
is($S0, '-2', "check box integer")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
.end
Expand All @@ -81,7 +81,7 @@ Tests C<LuaNumber> PMC
$P0 = new 'LuaNumber'
set $P0, 3.14
$S0 = $P0
is($S0, '3.14')
is($S0, '3.14', "check tostring")
$P1 = $P0.'tostring'()
$S0 = $P1
is($S0, '3.14')
Expand All @@ -93,7 +93,7 @@ Tests C<LuaNumber> PMC
$P0 = new 'LuaNumber'
set $P0, 3.14
$S0 = $P0
is($S0, '3.14')
is($S0, '3.14', "check tonumber")
$P1 = $P0.'tonumber'()
$S0 = $P1
is($S0, '3.14')
Expand Down

0 comments on commit d7bf31c

Please sign in to comment.