Add two trivial tests
@@ -92,3 +92,45 @@ class TestResultRegexes(DeferrableTestCase):
results = panel.find_all_results()
self.assertEqual(results, RESULT)
+
+ @p.expand(
+ [
+ (
+ {'/a.py': [std_error()], '/b.py': [std_error()], '/c.py': [std_error()]},
+ [('/b.py', 1, 1), ('/c.py', 1, 1), ('/a.py', 1, 1)],
+ '/a.py'
+ ),
+ ]
+ )
+ def test_active_file_comes_last(self, ERRORS, RESULT, ACTIVE_FILE):
+ window = self.window
+ when(panel_view).get_window_errors(...).thenReturn(ERRORS)
+ panel_view.State['active_filename'] = ACTIVE_FILE
+
+ panel_view.fill_panel(window)
+ panel = panel_view.get_panel(window)
+ # The interface updates async.
+ yield lambda: panel.find(CODE, 0, sublime.LITERAL)
+
+ results = panel.find_all_results()
+ self.assertEqual(results, RESULT)
+
+ @p.expand(
+ [
+ (
+ {'/b.py': [std_error()], '/c.py': [std_error()]},
+ [('/b.py', 1, 1), ('/c.py', 1, 1)],
+ '/a.py'
+ ),
+ ]
+ )
+ def test_clean_active_file_displays_std_message(self, ERRORS, RESULT, ACTIVE_FILE):
+ window = self.window
+ when(panel_view).get_window_errors(...).thenReturn(ERRORS)
+ panel_view.State['active_filename'] = ACTIVE_FILE
+
+ panel_view.fill_panel(window)
+ panel = panel_view.get_panel(window)
+ # The interface updates async.
+ match = yield lambda: panel.find('a.py:\n No lint results', 0, sublime.LITERAL)
+ self.assertTrue(match)
