diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-03-30 14:27:25 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-03-30 14:27:25 +0100 |
| commit | d299b608799b3b722e97ba0b3f41edb122dc4786 (patch) | |
| tree | d239a0c5c28ece59999b5b8fee2059a8f7796925 /src/test/java/org/zwobble | |
| parent | eda05cc1e2f845b4e7c3eeea505c535432240197 (diff) | |
Remove duplicates when finding captured variables
Diffstat (limited to 'src/test/java/org/zwobble')
| -rw-r--r-- | src/test/java/org/zwobble/couscous/tests/CompilerTests.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/couscous/tests/CompilerTests.java b/src/test/java/org/zwobble/couscous/tests/CompilerTests.java index 7df7582..0099d26 100644 --- a/src/test/java/org/zwobble/couscous/tests/CompilerTests.java +++ b/src/test/java/org/zwobble/couscous/tests/CompilerTests.java @@ -181,6 +181,18 @@ public abstract class CompilerTests { } @Test + public void lambdasWithSameVariableCapturedMultipleTimes() throws Exception { + assertEquals( + value(84), + execTestProgram( + "lambda-multiple-capture", + ScalarType.of("com.example.Lambda"), + "value", + list(value(2)), + Types.INT)); + } + + @Test public void lambdasWithThisCapture() throws Exception { assertEquals( value(42), |
