edgeql: Add more cast tests.
@@ -199,6 +199,40 @@ class TestExpressions(tb.QueryTestCase):
[[123, 11]],
])
+ async def test_edgeql_expr_cast06(self):
+ await self.assert_query_result(r"""
+ SELECT <array<bool>>['t', 'tr', 'tru', 'true'];
+ SELECT <array<bool>>['T', 'TR', 'TRU', 'TRUE'];
+ SELECT <array<bool>>['True', 'TrUe', '1'];
+ SELECT <array<bool>>['y', 'ye', 'yes'];
+ SELECT <array<bool>>['Y', 'YE', 'YES'];
+ SELECT <array<bool>>['Yes', 'yEs', 'YeS'];
+ """, [
+ [[True, True, True, True]],
+ [[True, True, True, True]],
+ [[True, True, True]],
+ [[True, True, True]],
+ [[True, True, True]],
+ [[True, True, True]],
+ ])
+
+ async def test_edgeql_expr_cast07(self):
+ await self.assert_query_result(r"""
+ SELECT <array<bool>>['f', 'fa', 'fal', 'fals', 'false'];
+ SELECT <array<bool>>['F', 'FA', 'FAL', 'FALS', 'FALSE'];
+ SELECT <array<bool>>['False', 'FaLSe', '0'];
+ SELECT <array<bool>>['n', 'no'];
+ SELECT <array<bool>>['N', 'NO'];
+ SELECT <array<bool>>['No', 'nO'];
+ """, [
+ [[False, False, False, False, False]],
+ [[False, False, False, False, False]],
+ [[False, False, False]],
+ [[False, False]],
+ [[False, False]],
+ [[False, False]],
+ ])
+
async def test_edgeql_expr_type01(self):
await self.assert_query_result(r"""
SELECT 'foo'.__class__.name;
