"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/libponyc/sugar.cc" between
ponyc-0.33.1.tar.gz and ponyc-0.33.2.tar.gz

About: Pony is an object-oriented, actor-model, capabilities-secure, high performance programming language.

sugar.cc  (ponyc-0.33.1):sugar.cc  (ponyc-0.33.2)
skipping to change at line 611 skipping to change at line 611
{ {
const char* short_form = const char* short_form =
"class Foo\n" "class Foo\n"
" var create: U32\n" " var create: U32\n"
" fun f(): U32 val =>\n" " fun f(): U32 val =>\n"
" if 1 then 2 else 3 end"; " if 1 then 2 else 3 end";
TEST_COMPILE(short_form); TEST_COMPILE(short_form);
} }
TEST_F(SugarTest, NotIf)
{
const char* short_form =
"class Foo\n"
" fun f() =>\n"
" let a = true\n"
" if not if a then not a else a end then a end";
TEST_COMPILE(short_form);
}
TEST_F(SugarTest, WhileWithoutElse) TEST_F(SugarTest, WhileWithoutElse)
{ {
const char* short_form = const char* short_form =
"class Foo\n" "class Foo\n"
" var create: U32\n" " var create: U32\n"
" fun f(): U32 val =>\n" " fun f(): U32 val =>\n"
" while 1 do 2 end"; " while 1 do 2 end";
const char* full_form = const char* full_form =
"use \"builtin\"\n" "use \"builtin\"\n"
skipping to change at line 640 skipping to change at line 651
{ {
const char* short_form = const char* short_form =
"class Foo\n" "class Foo\n"
" var create: U32\n" " var create: U32\n"
" fun f(): U32 val =>\n" " fun f(): U32 val =>\n"
" while 1 do 2 else 3 end"; " while 1 do 2 else 3 end";
TEST_COMPILE(short_form); TEST_COMPILE(short_form);
} }
TEST_F(SugarTest, NotWhileWithElse)
{
const char* short_form =
"class Foo\n"
" fun f(): U32 val =>\n"
" let a = true\n"
" not while a do true else false end";
TEST_COMPILE(short_form);
}
TEST_F(SugarTest, TryWithElseAndThen) TEST_F(SugarTest, TryWithElseAndThen)
{ {
const char* short_form = const char* short_form =
"class Foo\n" "class Foo\n"
" var create: U32\n" " var create: U32\n"
" fun f(): U32 val =>\n" " fun f(): U32 val =>\n"
" try 1 else 2 then 3 end"; " try 1 else 2 then 3 end";
TEST_COMPILE(short_form); TEST_COMPILE(short_form);
} }
skipping to change at line 765 skipping to change at line 787
" then\n" " then\n"
" None\n" " None\n"
" end\n" " end\n"
" (2)\n" " (2)\n"
" else 3 end\n" " else 3 end\n"
" )"; " )";
TEST_EQUIV(short_form, full_form); TEST_EQUIV(short_form, full_form);
} }
TEST_F(SugarTest, NotForWithElse)
{
const char* short_form =
"class Foo\n"
" fun f()=>\n"
" not for i in 1 do true else false end";
TEST_COMPILE(short_form);
}
TEST_F(SugarTest, MultiIteratorFor) TEST_F(SugarTest, MultiIteratorFor)
{ {
const char* short_form = const char* short_form =
"class Foo\n" "class Foo\n"
" var create: U32\n" " var create: U32\n"
" fun f(): U32 val =>\n" " fun f(): U32 val =>\n"
" for (i, j) in 1 do 2 end"; " for (i, j) in 1 do 2 end";
const char* full_form = const char* full_form =
"use \"builtin\"\n" "use \"builtin\"\n"
 End of changes. 3 change blocks. 
0 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)