Skip to content

Instantly share code, notes, and snippets.

@agentzh
Created March 27, 2017 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agentzh/5154642d55a6727c653858849b0698cf to your computer and use it in GitHub Desktop.
Save agentzh/5154642d55a6727c653858849b0698cf to your computer and use it in GitHub Desktop.
tests for fanlang
use t::FanLang 'no_plan';
#no_diff();
run_tests();
__DATA__
=== TEST 1: hello world
--- fan
say("hello, world");
--- out
hello, world
=== TEST 2: simple arithmetic
--- fan
say(3+5*2);
--- out
13
=== TEST 3: code block
--- fan
{
print("hi, ");
say(56.4);
}
--- out
hi, 56.4
=== TEST 4: with unary -
--- fan
say(-32 + 1);
--- out
-31
=== TEST 5: with unary +
--- fan
say(+32 + 1);
--- out
33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment