[svn:parrot] r43197 - trunk/t/compilers/imcc/syn
bubaflub at svn.parrot.org
bubaflub at svn.parrot.org
Tue Dec 22 05:40:10 UTC 2009
Author: bubaflub
Date: Tue Dec 22 05:40:10 2009
New Revision: 43197
URL: https://trac.parrot.org/parrot/changeset/43197
Log:
convert t/compilers/imcc/syn/labels.t to PIR
Modified:
trunk/t/compilers/imcc/syn/labels.t
Modified: trunk/t/compilers/imcc/syn/labels.t
==============================================================================
--- trunk/t/compilers/imcc/syn/labels.t Tue Dec 22 05:38:20 2009 (r43196)
+++ trunk/t/compilers/imcc/syn/labels.t Tue Dec 22 05:40:10 2009 (r43197)
@@ -1,63 +1,49 @@
-#!perl
-# Copyright (C) 2001-2007, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Config;
-use Parrot::Test tests => 3;
+.sub main :main
+ .include 'test_more.pir'
+ plan(4)
+
+ test_goto_1()
+ test_goto_2()
+ test_illegal_label()
+.end
-##############################
-pir_output_is( <<'CODE', <<'OUT', "goto 1" );
-.sub test :main
+.sub test_goto_1
goto foo
- end
-foo:
- print "ok 1\n"
- end
+ .return()
+ foo:
+ ok(1, 'goto 1')
.end
-CODE
-ok 1
-OUT
-
-##############################
-pir_output_is( <<'CODE', <<'OUT', "goto 2" );
-.sub test :main
+.sub test_goto_2
goto foo
-bar: print "ok 2\n"
- end
-foo:
- print "ok 1\n"
+ bar:
+ ok(1, 'goto 2')
+ .return()
+ foo:
+ ok(1, 'goto 2')
goto bar
.end
-CODE
-ok 1
-ok 2
-OUT
-
-##############################
-pir_error_output_like( <<'CODE', <<'OUT', "illegal label" );
-.sub bogus
+.sub test_illegal_label
+ throws_like( <<'CODE', 'no\ label\ offset\ defined', 'illegal label' )
+.sub bogus :main
goto _function
print "never\n"
- end
+ .return()
.end
.sub _function
print "in function\n"
.return()
.end
CODE
-/no label offset defined/
-OUT
-
-
+.end
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
-# vim: expandtab shiftwidth=4:
+# vim: expandtab shiftwidth=4 filetype=pir:
More information about the parrot-commits
mailing list