@@ -31,6 +31,11 @@ def test_bool_type():
3131 t , f = BoolType (True ), BoolType (False )
3232 exc = CELEvalError (("summary" , "details" ))
3333
34+ assert all (BoolType (s ) == t for s in ("True" , "true" , "TRUE" , "t" ))
35+ assert all (BoolType (s ) == f for s in ("False" , "false" , "FALSE" , "f" ))
36+ assert BoolType ("1" ) == t
37+ assert BoolType ("0" ) == f
38+
3439 assert logical_condition (t , sentinel .true , sentinel .false ) == sentinel .true
3540 assert logical_condition (f , sentinel .true , sentinel .false ) == sentinel .false
3641 with pytest .raises (TypeError ):
@@ -62,6 +67,7 @@ def test_bool_type():
6267 assert logical_not (f ) == t
6368 with pytest .raises (TypeError ):
6469 logical_not (StringType ("nope" ))
70+ assert logical_not (exc ) == exc
6571
6672 assert repr (f ) == "BoolType(False)"
6773 assert repr (t ) == "BoolType(True)"
@@ -211,10 +217,12 @@ def test_list_type():
211217 [IntType (42 ), StringType ("2.718281828459045**1.791759469228055" ), IntType (7 )]
212218 )
213219 assert l_1 == l_1
220+ assert not l_1 == None
214221 with pytest .raises (TypeError ):
215222 assert l_1 != l_2
216223 with pytest .raises (TypeError ):
217224 assert not l_1 == l_2
225+
218226 assert repr (l_1 ) == "ListType([IntType(42), IntType(6), IntType(7)])"
219227 with pytest .raises (TypeError ):
220228 l_1 < l_2
@@ -264,6 +272,7 @@ def test_map_type():
264272 )
265273 assert m_1 == m_1
266274 assert m_1 == m_3
275+ assert not m_1 == None
267276 assert not m_1 != m_1
268277 assert not m_single != m_single
269278 with pytest .raises (TypeError ):
0 commit comments