Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a stub test file for testing subclasses in NumMatrix2D. Can't use…
… Test::More here for some reason, so brewing my own
- Loading branch information
1 parent
cfcbcb1
commit 297a02f
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!parrot | ||
|
||
|
||
.HLL 'NumMatrix2D_SUBCLASS_TEST' | ||
|
||
.sub test | ||
$P0 = get_class 'Float' | ||
$P1 = subclass $P0, 'TestFloat' | ||
$P2 = getinterp | ||
$P2.'hll_map'($P0, $P1) | ||
|
||
$P3 = box 0 | ||
set_hll_global ['Test'], '_count', $P3 | ||
|
||
say "1..1" | ||
test_get_pmc_keyed() | ||
.end | ||
|
||
.sub is_TestFloat | ||
.param pmc arg | ||
|
||
$S0 = typeof arg | ||
if $S0 == 'TestFloat' goto are_equal | ||
print "not " | ||
are_equal: | ||
print "ok " | ||
$P0 = get_hll_global ['Test'], '_count' | ||
inc $P0 | ||
say $P0 | ||
.end | ||
|
||
.sub test_get_pmc_keyed | ||
$P0 = new ['NumMatrix2D'] | ||
$P0.'initialize_from_args'(2, 2, 1, 2, 3, 4) | ||
$P1 = $P0[0;0] | ||
is_TestFloat($P1) | ||
.end | ||
|
||
|