From dcd67a6e21c2fb523caa5dc9c41e62fcd4e45319 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sun, 30 Nov 2014 06:48:25 +0100 Subject: Better handling of floats in UPDATE statements (issue145). --- tests/test_grouping.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/test_grouping.py b/tests/test_grouping.py index 93f1b0e..86d4c7a 100644 --- a/tests/test_grouping.py +++ b/tests/test_grouping.py @@ -278,6 +278,15 @@ def test_comparison_with_keywords(): # issue90 assert isinstance(p.tokens[0], sql.Comparison) +def test_comparison_with_floats(): # issue145 + p = sqlparse.parse('foo = 25.5')[0] + assert len(p.tokens) == 1 + assert isinstance(p.tokens[0], sql.Comparison) + assert len(p.tokens[0].tokens) == 5 + assert p.tokens[0].left.value == 'foo' + assert p.tokens[0].right.value == '25.5' + + def test_comparison_with_parenthesis(): # issue23 p = sqlparse.parse('(3 + 4) = 7')[0] assert len(p.tokens) == 1 -- cgit v1.2.1