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

Commit

Permalink
refactor PIR tests with ok & nok (instead of is)
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Sep 7, 2009
1 parent 3261341 commit fc8a480
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 69 deletions.
12 changes: 6 additions & 6 deletions t/pmc/boolean.t
Expand Up @@ -31,21 +31,21 @@ Tests C<LuaBoolean> PMC
.sub 'check_inheritance'
$P0 = new 'LuaBoolean'
$I0 = isa $P0, 'LuaAny'
is($I0, 1, "check inheritance")
ok($I0, "check inheritance")
$I0 = isa $P0, 'LuaBoolean'
is($I0, 1)
ok($I0)
.end

.sub 'check_interface'
$P0 = new 'LuaBoolean'
$I0 = does $P0, 'scalar'
is($I0, 1, "check interface")
ok($I0, "check interface")
$I0 = does $P0, 'boolean'
is($I0, 1)
ok($I0)
$I0 = does $P0, 'integer'
is($I0, 1)
ok($I0)
$I0 = does $P0, 'no_interface'
is($I0, 0)
nok($I0)
.end

.sub 'check_name'
Expand Down
4 changes: 2 additions & 2 deletions t/pmc/boolean_hll.t
Expand Up @@ -35,15 +35,15 @@ Tests C<LuaBoolean> PMC
$S0 = $P0
is($S0, 'true', "check HLL")
$I0 = isa $P0, 'LuaBoolean'
is($I0, 1)
ok($I0)
.end

.sub 'check_HLL_const'
.const 'LuaBoolean' K = '1'
$S0 = K
is($S0, 'true', "check HLL & .const")
$I0 = isa K, 'LuaBoolean'
is($I0, 1)
ok($I0)
.end

.sub 'check_tostring'
Expand Down
20 changes: 10 additions & 10 deletions t/pmc/function.t
Expand Up @@ -33,25 +33,25 @@ Tests C<LuaFunction> PMC
.sub 'check_inheritance'
$P0 = new 'LuaFunction'
$I0 = isa $P0, 'scalar'
is($I0, 0, "check inheritance")
nok($I0, "check inheritance")
$I0 = isa $P0, 'Sub'
is($I0, 1)
ok($I0)
$I0 = isa $P0, 'Closure'
is($I0, 0)
nok($I0)
$I0 = isa $P0, 'LuaAny'
is($I0, 1)
ok($I0)
$I0 = isa $P0, 'LuaFunction'
is($I0, 1)
ok($I0)
.end

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

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

.sub f1
Expand Down
14 changes: 7 additions & 7 deletions t/pmc/function_hll.t
Expand Up @@ -36,12 +36,12 @@ Tests C<LuaFunction> PMC
# .const 'LuaFunction' F1 = 'f1'
.const 'Sub' F1 = 'f1'
$I0 = isa F1, 'LuaFunction'
is($I0, 1, "check HLL")
ok($I0, "check HLL")
$S0 = F1()
is($S0, "f1()")
.const 'Sub' F2 = 'f2'
$I0 = isa F2, 'LuaFunction'
is($I0, 1)
ok($I0)
$S0 = F2()
is($S0, "f2()")
.end
Expand All @@ -57,10 +57,10 @@ Tests C<LuaFunction> PMC
.sub 'check_HLL_autoboxing'
$P0 = fct1()
$I0 = isa $P0, 'LuaFunction'
is($I0, 1, "check HLL autoboxing")
ok($I0, "check HLL autoboxing")
$P0 = fct2()
$I0 = isa $P0, 'LuaFunction'
is($I0, 1)
ok($I0)
.end

.sub 'fct1'
Expand Down Expand Up @@ -97,7 +97,7 @@ Tests C<LuaFunction> PMC
.const 'Sub'F1 = 'f1'
$P0 = new 'LuaFunction', F1
$I0 = isa $P0, 'LuaFunction'
is($I0, 1, "check init_pmc")
ok($I0, "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, "load from pbc")
ok($I0, "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, "load from pbc")
ok($I0, "load from pbc")
# $P2($P2)
.end

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

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

.sub 'check_name'
Expand Down
4 changes: 2 additions & 2 deletions t/pmc/nil_hll.t
Expand Up @@ -34,15 +34,15 @@ Tests C<LuaNil> PMC
$S0 = $P0
is($S0, 'nil', "check HLL")
$I0 = isa $P0, 'LuaNil'
is($I0, 1)
ok($I0)
.end

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

.sub 'check_tostring'
Expand Down
10 changes: 5 additions & 5 deletions t/pmc/number.t
Expand Up @@ -32,19 +32,19 @@ Tests C<LuaNumber> PMC
.sub 'check_inheritance'
$P0 = new 'LuaNumber'
$I0 = isa $P0, 'LuaAny'
is($I0, 1, "check inheritance")
ok($I0, "check inheritance")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
ok($I0)
.end

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

.sub 'check_name'
Expand Down
10 changes: 5 additions & 5 deletions t/pmc/number_hll.t
Expand Up @@ -38,15 +38,15 @@ Tests C<LuaNumber> PMC
$S0 = $P0
is($S0, '3.14', "check HLL")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
ok($I0)
.end

.sub 'check_HLL_autoboxing'
$P0 = fct()
$S0 = $P0
is($S0, '3.14', "check HLL autoboxing")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
ok($I0)
.end

.sub 'fct' :anon
Expand All @@ -58,23 +58,23 @@ Tests C<LuaNumber> PMC
$S0 = K
is($S0, '3.14', "check HLL & .const")
$I0 = isa K, 'LuaNumber'
is($I0, 1)
ok($I0)
.end

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

.sub 'check_box_integer'
$P0 = box -2
$S0 = $P0
is($S0, '-2', "check box integer")
$I0 = isa $P0, 'LuaNumber'
is($I0, 1)
ok($I0)
.end

.sub 'check_tostring'
Expand Down
10 changes: 5 additions & 5 deletions t/pmc/string.t
Expand Up @@ -33,19 +33,19 @@ Tests C<LuaString> PMC
.sub 'check_inheritance'
$P0 = new 'LuaString'
$I0 = isa $P0, 'LuaAny'
is($I0, 1, "check inheritance")
ok($I0, "check inheritance")
$I0 = isa $P0, 'LuaString'
is($I0, 1)
ok($I0)
.end

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

.sub 'check_name'
Expand Down
10 changes: 5 additions & 5 deletions t/pmc/string_hll.t
Expand Up @@ -40,15 +40,15 @@ Tests C<LuaString> PMC
$S0 = $P0
is($S0, "simple string", "check HLL")
$I0 = isa $P0, 'LuaString'
is($I0, 1)
ok($I0)
.end

.sub 'check_HLL_autoboxing'
$P0 = fct()
$S0 = $P0
is($S0, "simple string", "check HLL autoboxing")
$I0 = isa $P0, 'LuaString'
is($I0, 1)
ok($I0)
.end

.sub 'fct' :anon
Expand All @@ -60,23 +60,23 @@ Tests C<LuaString> PMC
$S0 = K
is($S0, "simple string", "check HLL & .const")
$I0 = isa K, 'LuaString'
is($I0, 1)
ok($I0)
.end

.sub 'check_empty_string'
.const 'LuaString' K = ''
$S0 = K
is($S0, '', "check empty string")
$I0 = isa K, 'LuaString'
is($I0, 1)
ok($I0)
.end

.sub 'check_box'
$P0 = box "simple string"
$S0 = $P0
is($S0, "simple string", "check box")
$I0 = isa $P0, 'LuaString'
is($I0, 1)
ok($I0)
.end

.sub 'check_is_equal'
Expand Down
10 changes: 5 additions & 5 deletions t/pmc/table.t
Expand Up @@ -36,19 +36,19 @@ Tests C<table> type
.sub 'check_inheritance'
$P0 = new 'LuaTable'
$I0 = isa $P0, 'scalar'
is($I0, 0, "check ingeritance")
nok($I0, "check ingeritance")
$I0 = isa $P0, 'LuaAny'
is($I0, 1)
ok($I0)
$I0 = isa $P0, 'LuaTable'
is($I0, 1)
ok($I0)
.end

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

.sub 'check_name'
Expand Down
2 changes: 1 addition & 1 deletion t/pmc/table_hll.t
Expand Up @@ -33,7 +33,7 @@ Tests C<table> type
.sub 'check_HLL'
$P0 = new 'LuaTable'
$I0 = isa $P0, 'LuaTable'
is($I0, 1, "check HLL")
ok($I0, "check HLL")
.end

.sub 'check_len'
Expand Down
10 changes: 5 additions & 5 deletions t/pmc/thread.t
Expand Up @@ -35,11 +35,11 @@ Tests Lua C<thread> type
.const 'Sub' F1 = 'f1'
$P0 = new 'LuaThread', F1
$I0 = isa $P0, 'scalar'
is($I0, 0, "check inheritance")
nok($I0, "check inheritance")
$I0 = isa $P0, 'LuaAny'
is($I0, 1)
ok($I0)
$I0 = isa $P0, 'LuaThread'
is($I0, 1)
ok($I0)
.end

.sub 'f1'
Expand All @@ -51,9 +51,9 @@ Tests Lua C<thread> type
.const 'Sub' F1 = 'f1'
$P0 = new 'LuaThread', F1
$I0 = does $P0, 'scalar'
is($I0, 1, "check interface")
ok($I0, "check interface")
$I0 = does $P0, 'no_interface'
is($I0, 0)
nok($I0)
.end

.sub 'check_name'
Expand Down
2 changes: 1 addition & 1 deletion t/pmc/thread_hll.t
Expand Up @@ -35,7 +35,7 @@ Tests Lua C<thread> type
.const 'Sub' F1 = 'f1'
$P0 = new 'LuaThread', F1
$I0 = isa $P0, 'LuaThread'
is($I0, 1, "check HLL")
ok($I0, "check HLL")
.end

.sub 'f1'
Expand Down

0 comments on commit fc8a480

Please sign in to comment.