mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-29 05:11:00 +00:00
Add tests for Perl and Turning detection
This commit is contained in:
10
test/fixtures/perl-test.t
vendored
Normal file
10
test/fixtures/perl-test.t
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Foo::Bar
|
||||
|
||||
$n = 42;
|
||||
$name = "world";
|
||||
@array = ("1","2","3");
|
||||
%hash = ("foo":"bar");
|
||||
my $name = "josh";
|
||||
19
test/fixtures/turing.t
vendored
Normal file
19
test/fixtures/turing.t
vendored
Normal 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)
|
||||
Reference in New Issue
Block a user