Add tests for Perl and Turning detection

This commit is contained in:
Joshua Peek
2011-11-21 10:42:39 -06:00
parent 0b5a265644
commit e4fe1d17e7
5 changed files with 48 additions and 4 deletions

19
test/fixtures/turing.t vendored Normal file
View File

@@ -0,0 +1,19 @@
% Accepts a number and calculates its factorial
function factorial (n: int) : real
if n = 0 then
result 1
else
result n * factorial (n - 1)
end if
end factorial
var n: int
loop
put "Please input an integer: " ..
get n
exit when n >= 0
put "Input must be a non-negative integer."
end loop
put "The factorial of ", n, " is ", factorial (n)