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