You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
621 B
24 lines
621 B
#!/usr/bin/python
|
|
|
|
# Tests for litlint.py
|
|
#
|
|
# Usage: python litlint_test.py
|
|
#
|
|
# Returns nonzero if any test fails
|
|
|
|
import litlint
|
|
import unittest
|
|
|
|
class TestLintLine(unittest.TestCase):
|
|
def test_missing_run(self):
|
|
f = litlint.LintLine
|
|
self.assertEqual(f(' %t '), ('missing %run before %t', 2))
|
|
self.assertEqual(f(' %t\n'), ('missing %run before %t', 2))
|
|
self.assertEqual(f(' %t.so '), (None, None))
|
|
self.assertEqual(f(' %t.o '), (None, None))
|
|
self.assertEqual(f('%run %t '), (None, None))
|
|
self.assertEqual(f('-o %t '), (None, None))
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|