develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33575 - branches/testparrottest/t/perl

From:
jkeenan
Date:
December 6, 2008 09:56
Subject:
[svn:parrot] r33575 - branches/testparrottest/t/perl
Message ID:
20081206175630.BD15FCB9AF@x12.develooper.com
Author: jkeenan
Date: Sat Dec  6 09:56:29 2008
New Revision: 33575

Modified:
   branches/testparrottest/t/perl/Parrot_Test.t

Log:
Refactor C code used in CODE into .

Modified: branches/testparrottest/t/perl/Parrot_Test.t
==============================================================================
--- branches/testparrottest/t/perl/Parrot_Test.t	(original)
+++ branches/testparrottest/t/perl/Parrot_Test.t	Sat Dec  6 09:56:29 2008
@@ -319,6 +319,56 @@
     test_test($desc);
 }
 
+##### C-output test functions #####
+
+my $c_code = <<'ENDOFCODE';
+    #include <stdio.h>
+    #include <stdlib.h>
+
+    int
+    main(int argc, char* argv[])
+    {
+        printf("Hello, World!\n");
+        exit(0);
+    }
+ENDOFCODE
+
+$desc = 'C:  hello world';
+test_out("ok 1 - $desc");
+c_output_is( <<CODE, <<'OUTPUT', $desc );
+$c_code
+CODE
+Hello, World!
+OUTPUT
+test_test($desc);
+
+$desc = 'C:  isnt hello world';
+test_out("ok 1 - $desc");
+c_output_isnt( <<CODE, <<'OUTPUT', $desc );
+$c_code
+CODE
+Is Not Hello, World!
+OUTPUT
+test_test($desc);
+
+$desc = 'C:  like hello world';
+test_out("ok 1 - $desc");
+c_output_like( <<CODE, <<'OUTPUT', $desc );
+$c_code
+CODE
+/Hello, World/
+OUTPUT
+test_test($desc);
+
+$desc = 'C:  unlike hello world';
+test_out("ok 1 - $desc");
+c_output_unlike( <<CODE, <<'OUTPUT', $desc );
+$c_code
+CODE
+/foobar/
+OUTPUT
+test_test($desc);
+
 ##### Tests for Parrot::Test internal subroutines #####
 
 # _handle_test_options()
@@ -498,74 +548,6 @@
 test_test($desc);
 }
 
-$desc = 'C:  hello world';
-test_out("ok 1 - $desc");
-c_output_is( <<'CODE', <<'OUTPUT', $desc );
-    #include <stdio.h>
-    #include <stdlib.h>
-
-    int
-    main(int argc, char* argv[])
-    {
-        printf("Hello, World!\n");
-        exit(0);
-    }
-CODE
-Hello, World!
-OUTPUT
-test_test($desc);
-
-$desc = 'C:  isnt hello world';
-test_out("ok 1 - $desc");
-c_output_isnt( <<'CODE', <<'OUTPUT', $desc );
-    #include <stdio.h>
-    #include <stdlib.h>
-
-    int
-    main(int argc, char* argv[])
-    {
-        printf("Hello, World!\n");
-        exit(0);
-    }
-CODE
-Is Not Hello, World!
-OUTPUT
-test_test($desc);
-
-$desc = 'C:  like hello world';
-test_out("ok 1 - $desc");
-c_output_like( <<'CODE', <<'OUTPUT', $desc );
-    #include <stdio.h>
-    #include <stdlib.h>
-
-    int
-    main(int argc, char* argv[])
-    {
-        printf("Hello, World!\n");
-        exit(0);
-    }
-CODE
-/Hello, World/
-OUTPUT
-test_test($desc);
-
-$desc = 'C:  unlike hello world';
-test_out("ok 1 - $desc");
-c_output_unlike( <<'CODE', <<'OUTPUT', $desc );
-    #include <stdio.h>
-    #include <stdlib.h>
-
-    int
-    main(int argc, char* argv[])
-    {
-        printf("Hello, World!\n");
-        exit(0);
-    }
-CODE
-/foobar/
-OUTPUT
-test_test($desc);
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About