Skip to content

Commit

Permalink
Added a test related to issue #441.
Browse files Browse the repository at this point in the history
  • Loading branch information
Anastassija committed Dec 13, 2013
1 parent a35caf9 commit 8d8742b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module experiments::Compiler::Examples::NestedFunctions

int f() {
int g() = 101;
int () k() {
int () h() = g;
return h();
};
return k()();
}

value main(list[value] args) {
return f();
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import experiments::Compiler::Examples::AsType1;
import experiments::Compiler::Examples::AsType2;
import experiments::Compiler::Examples::Bottles;
import experiments::Compiler::Examples::Capture;
import experiments::Compiler::Examples::NestedFunctions;
import experiments::Compiler::Examples::E1E2;
import experiments::Compiler::Examples::Fac;
import experiments::Compiler::Examples::Fib;
Expand Down Expand Up @@ -145,6 +146,11 @@ test bool tst() = demo("IMP3") == experiments::Compiler::Examples::IMP3::main([]
test bool tst() = demo("FailWithLabel1") == experiments::Compiler::Examples::FailWithLabel1::main([]);
test bool tst() = demo("FailWithLabel2") == experiments::Compiler::Examples::FailWithLabel2::main([]);

// Keyword parameters
test bool tst() = demo("KWP1") == experiments::Compiler::Examples::KWP1::main([]);
test bool tst() = demo("KWP2") == experiments::Compiler::Examples::KWP2::main([]);
test bool tst() = demo("KWP3") == experiments::Compiler::Examples::KWP3::main([]);
test bool tst() = demo("KWP3") == experiments::Compiler::Examples::KWP3::main([]);

// Nested functions
// Note: fails
test bool tst1001() = demo("NestedFunctions") == experiments::Compiler::Examples::NestedFunctions::main([]);

0 comments on commit 8d8742b

Please sign in to comment.