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

Commit

Permalink
update PMC tests,
Browse files Browse the repository at this point in the history
the following syntax is gone :
  .const 'WmlsType' K = 'from string'
  • Loading branch information
fperrad committed Nov 7, 2009
1 parent db3475e commit 43328b9
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 75 deletions.
7 changes: 3 additions & 4 deletions .gitignore
Expand Up @@ -17,23 +17,22 @@ wmlscript/opcode.pir
wmlscript/stdlibs.pir
wmlscript/library/*.pbc

dynext/*.dll
dynext/*.so

dynext/ops/*.bundle
dynext/ops/*.c
dynext/ops/*.dll
dynext/ops/*.h
dynext/ops/*.o
dynext/ops/*.obj
dynext/ops/*.so

dynext/pmc/*.bundle
dynext/pmc/*.c
dynext/pmc/*.dll
dynext/pmc/*.dump
dynext/pmc/*.h
dynext/pmc/*.o
dynext/pmc/*.obj
dynext/pmc/*.pdb
dynext/pmc/*.so

t/*.out
t/*.pbc
Expand Down
3 changes: 3 additions & 0 deletions Makefile.in
Expand Up @@ -151,6 +151,9 @@ help:
test: all
$(PERL) t/harness

pmctest: all
prove --exec=$(PARROT) t/pmc//*.t

codetest: codetest-c codetest-make codetest-perl codetest-pir codetest-pod

T_C := dynext//pmc//*.pmc dynext//ops//*.ops
Expand Down
21 changes: 12 additions & 9 deletions t/pmc/boolean_hll.t
Expand Up @@ -39,30 +39,33 @@ Tests C<WmlsBoolean> PMC
.end

.sub 'check_istrue'
.const 'WmlsBoolean' K = '1'
$S0 = K
$P1 = new 'WmlsBoolean'
set $P1, 1
$S0 = $P1
is($S0, 'true', "check istrue")
$P0 = istrue K
$P0 = istrue $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
.end

.sub 'check_typeof'
.const 'WmlsBoolean' K = '1'
$S0 = K
$P1 = new 'WmlsBoolean'
set $P1, 1
$S0 = $P1
is($S0, 'true', "check typeof")
$P0 = typeof K
$P0 = typeof $P1
$I0 = $P0
is($I0, 3)
isa_ok($P0, 'WmlsInteger')
.end

.sub 'check_defined'
.const 'WmlsBoolean' K = '1'
$S0 = K
$P1 = new 'WmlsBoolean'
set $P1, 1
$S0 = $P1
is($S0, 'true', "check defined")
$P0 = defined K
$P0 = defined $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
Expand Down
31 changes: 13 additions & 18 deletions t/pmc/float_hll.t
Expand Up @@ -22,10 +22,9 @@ Tests C<WmlsFloat> PMC
.sub 'main' :main
.include 'test_more.pir'

plan(15)
plan(13)

check_HLL()
check_HLL_const()
check_istrue()
check_typeof()
check_defined()
Expand All @@ -40,38 +39,34 @@ Tests C<WmlsFloat> PMC
isa_ok($P0, 'WmlsFloat')
.end

.sub 'check_HLL_const'
.const 'WmlsFloat' K = '3.14'
$N0 = K
is($N0, 3.14, "check HLL & .const")
isa_ok(K, 'WmlsFloat')
.end

.sub 'check_istrue'
.const 'WmlsFloat' K = '3.14'
$N0 = K
$P1 = new 'WmlsFloat'
set $P1, 3.14
$N0 = $P1
is($N0, 3.14, "check istrue")
$P0 = istrue K
$P0 = istrue $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
.end

.sub 'check_typeof'
.const 'WmlsFloat' K = '3.14'
$N0 = K
$P1 = new 'WmlsFloat'
set $P1, 3.14
$N0 = $P1
is($N0, 3.14, "check typeof")
$P0 = typeof K
$P0 = typeof $P1
$I0 = $P0
is($I0, 1)
isa_ok($P0, 'WmlsInteger')
.end

.sub 'check_defined'
.const 'WmlsFloat' K = '3.14'
$N0 = K
$P1 = new 'WmlsFloat'
set $P1, 3.14
$N0 = $P1
is($N0, 3.14, "check defined")
$P0 = defined K
$P0 = defined $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
Expand Down
31 changes: 13 additions & 18 deletions t/pmc/integer_hll.t
Expand Up @@ -22,10 +22,9 @@ Tests C<WmlsInteger> PMC
.sub 'main' :main
.include 'test_more.pir'

plan(15)
plan(13)

check_HLL()
check_HLL_const()
check_istrue()
check_typeof()
check_defined()
Expand All @@ -40,38 +39,34 @@ Tests C<WmlsInteger> PMC
isa_ok($P0, 'WmlsInteger')
.end

.sub 'check_HLL_const'
.const 'WmlsInteger' K = '42'
$I0 = K
is($I0, 42, "check HLL & .const")
isa_ok(K, 'WmlsInteger')
.end

.sub 'check_istrue'
.const 'WmlsInteger' K = '42'
$I0 = K
$P1 = new 'WmlsInteger'
set $P1, 42
$I0 = $P1
is($I0, 42, "check istrue")
$P0 = istrue K
$P0 = istrue $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
.end

.sub 'check_typeof'
.const 'WmlsInteger' K = '42'
$I0 = K
$P1 = new 'WmlsInteger'
set $P1, 42
$I0 = $P1
is($I0, 42, "check typeof")
$P0 = typeof K
$P0 = typeof $P1
$I0 = $P0
is($I0, 0)
isa_ok($P0, 'WmlsInteger')
.end

.sub 'check_defined'
.const 'WmlsInteger' K = '42'
$I0 = K
$P1 = new 'WmlsInteger'
set $P1, 42
$I0 = $P1
is($I0, 42, "check defined")
$P0 = defined K
$P0 = defined $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
Expand Down
39 changes: 13 additions & 26 deletions t/pmc/string_hll.t
Expand Up @@ -22,11 +22,9 @@ Tests C<WmlsString> PMC
.sub 'main' :main
.include 'test_more.pir'

plan(17)
plan(13)

check_HLL()
check_HLL_const()
check_empty_string()
check_istrue()
check_typeof()
check_defined()
Expand All @@ -41,45 +39,34 @@ Tests C<WmlsString> PMC
isa_ok($P0, 'WmlsString')
.end

.sub 'check_HLL_const'
.const 'WmlsString' K = "simple string"
$S0 = K
is($S0, "simple string", "check HLL & .const")
isa_ok(K, 'WmlsString')
.end

.sub 'check_empty_string'
.const 'WmlsString' K = ''
$S0 = K
is($S0, '', "check empty string")
isa_ok(K, 'WmlsString')
.end

.sub 'check_istrue'
.const 'WmlsString' K = "simple string"
$S0 = K
$P1 = new 'WmlsString'
set $P1, "simple string"
$S0 = $P1
is($S0, "simple string", "check istrue")
$P0 = istrue K
$P0 = istrue $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
.end

.sub 'check_typeof'
.const 'WmlsString' K = "simple string"
$S0 = K
$P1 = new 'WmlsString'
set $P1, "simple string"
$S0 = $P1
is($S0, "simple string", "check typeof")
$P0 = typeof K
$P0 = typeof $P1
$I0 = $P0
is($I0, 2)
isa_ok($P0, 'WmlsInteger')
.end

.sub 'check_defined'
.const 'WmlsString' K = "simple string"
$S0 = K
$P1 = new 'WmlsString'
set $P1, "simple string"
$S0 = $P1
is($S0, "simple string", "check defined")
$P0 = defined K
$P0 = defined $P1
$S0 = $P0
is($S0, 'true')
isa_ok($P0, 'WmlsBoolean')
Expand Down

0 comments on commit 43328b9

Please sign in to comment.