From: Alex Smith Date: Fri, 3 Sep 2010 01:37:31 +0000 (+0100) Subject: Document interfunge and its testsuite; use an actual Befunge testsuite rather than... X-Git-Tag: 0.29~41^2~2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=7b67c18fa7e4f9e6c5d188d436ec708a6fd26cf3;p=intercal.git Document interfunge and its testsuite; use an actual Befunge testsuite rather than a Hello World 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. --- diff --git a/pit/interfunge.chk b/pit/interfunge.chk index 980a0d5..acd44d5 100644 --- a/pit/interfunge.chk +++ b/pit/interfunge.chk @@ -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 index 0000000..1e35744 --- /dev/null +++ b/pit/interfunge.doc @@ -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. diff --git a/pit/interfunge.tst b/pit/interfunge.tst index b014fbc..611a55e 100644 --- a/pit/interfunge.tst +++ b/pit/interfunge.tst @@ -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$#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 "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 ^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"+64055+"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_,#! #:"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"<