Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Test exception thrown by function calls using named and unamed args
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpetisme committed Mar 4, 2015
1 parent 3f47f2d commit 603ed6b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Expand Up @@ -1638,4 +1638,14 @@ public void test_named_parameters() throws Throwable {
result = (String) csvBuilder.invoke(null);
assertThat(result, is("a,b,c"));
}

@Test(expectedExceptions = IllegalArgumentException.class)
public void test_failure_function_call_with_named_and_unamed_args() throws Throwable {
try {
compileAndLoadGoloModule(SRC, "failure-function-call-with-named-and-unamed-args.golo");
fail("A GoloCompilationException was expected");
} catch (IllegalArgumentException expected) {
throw expected;
}
}
}
@@ -0,0 +1,6 @@
module golotest.execution.FunctionCallWithNamedAndUnamedArgs

function create_post = |author, title, content| -> author + " " + title + " " + content

function create_post_mixing_named_and_unamed_args = -> create_post("Lorem Ipsum", "Awesome Post", author = "John")

0 comments on commit 603ed6b

Please sign in to comment.