From 928627726cb08c447e7510f65abff18f0e65c27b Mon Sep 17 00:00:00 2001 From: Whiteknight Date: Wed, 8 Sep 2010 18:08:39 -0400 Subject: [PATCH] add a stub test for verifying subclass behavior. Test fails because of weirdness elsewhere in the dependency tree. --- t/pir-subclass/nummatrix2d.t | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 t/pir-subclass/nummatrix2d.t diff --git a/t/pir-subclass/nummatrix2d.t b/t/pir-subclass/nummatrix2d.t new file mode 100644 index 0000000..3eaf171 --- /dev/null +++ b/t/pir-subclass/nummatrix2d.t @@ -0,0 +1,31 @@ +.sub test_main + .include 'test_more.pir' + say "1..1" + + test_get_pmc_keyed() +.end + +#.HLL 'NumMatrix2D_HLL_Test' + +.sub '' :anon :init :load + $P0 = get_class ['Float'] + $P1 = subclass $P0, ['TestFloat'] + $P2 = getinterp + $P2.'hll_map'($P0, $P1) + .include 'test_more.pir' +.end + +.sub is_TestFloat + .param pmc arg + $S0 = typeof arg + 'is'($S0, 'TestFloat') +.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 + +# .HLL 'parrot'