From d764958a284de666462796c9195fdb00d521d78a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 5 Oct 2015 13:00:08 +0100 Subject: Add Python boolean values --- .../couscous/tests/backends/python/PythonSerializerTests.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/test/java/org') diff --git a/src/test/java/org/zwobble/couscous/tests/backends/python/PythonSerializerTests.java b/src/test/java/org/zwobble/couscous/tests/backends/python/PythonSerializerTests.java index 4f9b63b..8a608f8 100644 --- a/src/test/java/org/zwobble/couscous/tests/backends/python/PythonSerializerTests.java +++ b/src/test/java/org/zwobble/couscous/tests/backends/python/PythonSerializerTests.java @@ -6,6 +6,7 @@ import org.zwobble.couscous.backends.python.ast.PythonClassNode; import static java.util.Arrays.asList; import static org.junit.Assert.assertEquals; import static org.zwobble.couscous.backends.python.PythonSerializer.serialize; +import static org.zwobble.couscous.backends.python.ast.PythonBooleanLiteralNode.pythonBooleanLiteral; import static org.zwobble.couscous.backends.python.ast.PythonFunctionDefinitionNode.pythonFunctionDefinition; import static org.zwobble.couscous.backends.python.ast.PythonIntegerLiteralNode.pythonIntegerLiteral; import static org.zwobble.couscous.backends.python.ast.PythonModuleNode.pythonModule; @@ -29,6 +30,12 @@ public class PythonSerializerTests { assertEquals("\"blah\"", output); } + @Test + public void booleansAreNotBoxed() { + assertEquals("True", serialize(pythonBooleanLiteral(true))); + assertEquals("False", serialize(pythonBooleanLiteral(false))); + } + @Test public void returnKeywordIsUsedForReturns() { val output = serialize(pythonReturn(pythonIntegerLiteral(42))); -- cgit v1.2.3