summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authoratronah <atronah.ds@gmail.com>2017-04-29 14:49:38 +0300
committeratronah <atronah.ds@gmail.com>2017-04-30 19:07:14 +0300
commit4dd31c48c5ef42ea731e0c6a86b99cb3c89f0a6a (patch)
tree08546a16827a0e32fc8e05868f969843304e43c1 /tests
parent662280e5e6fa1953c8a4b93f98f301a40b86ba0f (diff)
downloadsqlparse-4dd31c48c5ef42ea731e0c6a86b99cb3c89f0a6a.tar.gz
adds '1.' option support for float numbers regex
Diffstat (limited to 'tests')
-rw-r--r--tests/test_keywords.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_keywords.py b/tests/test_keywords.py
new file mode 100644
index 0000000..c197f36
--- /dev/null
+++ b/tests/test_keywords.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+import pytest
+
+from sqlparse import tokens
+from sqlparse.keywords import SQL_REGEX
+
+
+class TestSQLREGEX:
+ @pytest.mark.parametrize('number', ['1.0', '-1.0',
+ '1.', '-1.',
+ '.1', '-.1'])
+ def test_float_numbers(self, number):
+ ttype = next(tt for action, tt in SQL_REGEX if action(number))
+ assert tokens.Number.Float == ttype