]> thyrsus.com Git - intercal.git/commitdiff
Document interfunge and its testsuite; use an actual Befunge testsuite rather than...
authorAlex Smith <ais523@bham.ac.uk>
Fri, 3 Sep 2010 01:37:31 +0000 (02:37 +0100)
committerAlex Smith <ais523@bham.ac.uk>
Fri, 3 Sep 2010 01:37:31 +0000 (02:37 +0100)
This now uses the (BSD-licensed and credited in a .doc file) Mycology test
suite by Matti Niemenmaa in order to test interfunge.i (and indirectly the
C-INTERCAL compiler itself), rather than the Hello World program that was
used as a test beforehand.

pit/interfunge.chk
pit/interfunge.doc [new file with mode: 0644]
pit/interfunge.tst

index 980a0d5f19a64b4b30a87d4206aade58726b60e3..acd44d5233b61827f916001d522f747132811952 100644 (file)
@@ -1 +1,36 @@
-Hello World!
+_
+
+ 
+I
+  
+II
+   
+III
+  
+IV
+ 
+V
+  
+VI
+   
+VII
+
+GOOD: , works
+GOOD: : duplicates
+GOOD: empty stack pops zero
+GOOD: 2-2 = 0
+GOOD: | works
+GOOD: 0! = 1
+GOOD: 7! = 0
+GOOD: 8*0 = 0
+GOOD: # < jumps into <
+GOOD: \ swaps
+GOOD: 01` = 0
+GOOD: 10` = 1
+GOOD: 900pg gets 9
+GOOD: p modifies space
+GOOD: wraparound works
+UNDEF: edge # hits column 80
+GOOD: Funge-93 spaces
+The Befunge-93 version of the Mycology test suite is done.
+Quitting...
diff --git a/pit/interfunge.doc b/pit/interfunge.doc
new file mode 100644 (file)
index 0000000..1e35744
--- /dev/null
@@ -0,0 +1,39 @@
+interfunge.i is a (GPL version 2) Befunge-93 interpreter by Jeffrey
+Lee; it hopefully implements the whole set of Befunge-93
+instructions.
+
+The provided test file interfunge.tst is the Befunge-93 version of
+Mycology by Matti Niemenmaa, and is under the following license:
+
+Copyright (c) 2006-2008, Matti Niemenmaa
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+        * Neither the name of the project nor the names of its contributors may be
+          used to endorse or promote products derived from this software without
+          specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+(Mycology is a standard Befunge testsuite used to test conformance to
+the specs; it therefore tests all parts of interfunge.i, and thus acts
+as a better stress-test on the INTERCAL compiler itself.) Hopefully,
+its output should be self-explanatory; the very first few tests print
+out the numbers 0 to 7, because they're before output is tested, but
+after that all the tests print GOOD: (for a success) or BAD: (for a
+failure) followed by what was tested.
index b014fbc97745d4dbccb9445891ff5a5f48cc23b9..611a55e238c78a66a80a913bd4f5bc33e760e564 100644 (file)
@@ -1,5 +1,23 @@
->              v
-v  ,,,,,"Hello"<
->48*,          v
-v,,,,,,"World!"<
->25*,@
+0#@>. 1#@v>#@,55+"skrow , :DOOG",,,,,,,,,,,,,,1#v:$v>"pud t'nseod : DAB",,,,,,,v
+v"@.4"@#<.+@,,,,,,,,,,,,,,,,"BAD: : reflects"+55<v _^          @,+55,,,,,,,,,,,<
+>$#v5#.< #5   >:#,_$v#"GGGOOD: : duplicates"+730$<>"OOG">:#,_22#v-#v_19+"0 = 2"v
+>3.#@$ .^@5v"ro"+820_28+"orez spop kcats ytpme :D"^v"-2 != 0"+550  <v"GOOD: 2-"<
+^ 0@# 4.2< >"eznon spop kcats ytpme :DAB"v  "BAD: - reflects"+55<   >:#,_v  >v  
+v.6_5.@>7.^>+"stcelfer \">" :DAB">:#,_@#:< "BAD: 2"<   v"GOOD: | works"+<>#v|>0v
+>80#@+#^_@ ^55>#0<  >:#,_ v#:"GOOD: 8*0 = 0"+5<v ># $< >:#,_v           ^550<  5
+v"D: # < jumps into <"+5<^     "8*0 != 0"+55< 5v"BAD: | goes the wrong way"5#+5<
+>"OOG">:#,_12#^\1-#v_8+v5^ "* reflects"+550<^_^>:#,_@#:<"BAD: | reflects"+5<    
+v   "GOOD: \ swaps"0#  <^ ># <46+"< rev"v>#^*^>" :DAB">:#,_@>#v!1-#v_55+"1 = "v 
+>:#,_1#v`v >"r `"  5> $  ^ "# < jumps o"<^8<> ^"! reflects"+64<v550<  v"D: 0!"< 
+v68+55<>055+"stce"v>5+"paws t'nseod "v>:#,_^^"7! != 0"+_v#!773<>+"1 =! !0 :DAB"v
+*   v_^#$< ^"23fl"]>^   $<0  "BAD: \"<^  "GOOD: 7! = 0"+<>:#,_^#"GGOO"<>:#,_@#:<
+    >055+"0 =! `10"^>1\`1-#v_55+"1 = `01 :DOOG">:#,_900#vp#vg9-v       ^"BAD: "<
+>" = `10 :DOOG">:#,_^      >55+"1 =! `01 :DAB"  0^      >055+    "stcelfer p"  ^
+v"difies space"+># 5# <  ^00      "900pg doesn't get 9"+55<>5+0 \"stcelfer g"  ^
+>"om p :DOOG"vv5 5p:+88"^"_,#! #:<"GOOD: 900pg gets 9"+55_^#!  <                
+     $_,#! #:<>+"ecaps yfidom t'nseod p :DAB">:#,_@v"GOOD: wraparound works"v###
+#                          " column 80",:+55_,#! #:<v"p skips column 80"+550< vv
+v         "GOOD: Funge-93 spaces"+55<               >"arw :DAB">:#,_@ v"skips"< 
+v "BAD: SGML spaces in Funge-93"+55_^#$\`"  !"_,#! #:<"UNDEF: edge # "<  "hits"<
+>:#,_55+"...gnittiuQ"55+".enod si etius tset ygolocyM eht fo noisrev 39-egnufe"v
+@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"The B"<