From 2ade4fcdd80cdb12ef12cf929021f64d20de53d2 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 17 May 2017 13:20:24 +0100 Subject: Add tests for bool literal --- test/libjulia/Parser.cpp | 6 ++++++ test/libsolidity/InlineAssembly.cpp | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'test') diff --git a/test/libjulia/Parser.cpp b/test/libjulia/Parser.cpp index c401f57b..d1081067 100644 --- a/test/libjulia/Parser.cpp +++ b/test/libjulia/Parser.cpp @@ -120,6 +120,12 @@ BOOST_AUTO_TEST_CASE(vardecl) BOOST_CHECK(successParse("{ let x:u256 := 7:u256 }")); } +BOOST_AUTO_TEST_CASE(vardecl_bool) +{ + BOOST_CHECK(successParse("{ let x:bool := true:bool }")); + BOOST_CHECK(successParse("{ let x:bool := false:bool }")); +} + BOOST_AUTO_TEST_CASE(assignment) { BOOST_CHECK(successParse("{ let x:u256 := 2:u256 let y:u256 := x }")); diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index b7046f80..0729c8db 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -161,6 +161,12 @@ BOOST_AUTO_TEST_CASE(vardecl) BOOST_CHECK(successParse("{ let x := 7 }")); } +BOOST_AUTO_TEST_CASE(vardecl_bool) +{ + CHECK_PARSE_ERROR("{ let x := true }", ParserError, "True and false are not valid literals."); + CHECK_PARSE_ERROR("{ let x := false }", ParserError, "True and false are not valid literals."); +} + BOOST_AUTO_TEST_CASE(assignment) { BOOST_CHECK(successParse("{ let x := 2 7 8 add =: x }")); -- cgit