paul@103 | 1 | #!/usr/bin/env python |
paul@103 | 2 | |
paul@103 | 3 | from TokenSupport import getIdentifiers |
paul@103 | 4 | |
paul@103 | 5 | tests = [ |
paul@103 | 6 | (1, False, """'contains space'""", ["contains space"]), |
paul@103 | 7 | (2, False, """contains space""", ["contains", "space"]), |
paul@103 | 8 | (1, False, '''"Python's syntax"''', ["Python's syntax"]), |
paul@103 | 9 | (2, False, """Python''s syntax""", ["Pythons", "syntax"]), |
paul@103 | 10 | (2, True, """Python''s syntax""", ["Python's", "syntax"]), |
paul@103 | 11 | (1, False, '''"Python's "'"intuitive" syntax' ''', ['''Python's "intuitive" syntax''']), |
paul@103 | 12 | (1, False, '''"Python's "intuitive" syntax" ''', ['''Python's intuitive syntax''']), |
paul@103 | 13 | ] |
paul@103 | 14 | |
paul@103 | 15 | for n, doubling, s, e in tests: |
paul@103 | 16 | l = getIdentifiers(s, doubling) |
paul@103 | 17 | print l == e, l, "==", e, len(l) == n, len(l), "==", n, "<-", doubling, s |
paul@103 | 18 | |
paul@103 | 19 | # vim: tabstop=4 expandtab shiftwidth=4 |