Skip to content

Commit

Permalink
add unit test misspellings
Browse files Browse the repository at this point in the history
  • Loading branch information
dschuyler committed Feb 21, 2019
1 parent a42a1e3 commit 4d62b6e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
46 changes: 46 additions & 0 deletions app/unit_test_misspellings.py
@@ -0,0 +1,46 @@
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import curses

from app.curses_util import *
import app.fake_curses_testing


class MisspellingsTestCases(app.fake_curses_testing.FakeCursesTestCase):

def setUp(self):
self.longMessage = True
app.fake_curses_testing.FakeCursesTestCase.setUp(self)

def test_highlight_misspellings(self):
#self.setMovieMode(True)
self.runWithFakeInputs([
self.displayCheck(0, 0, [u" ci "]),
self.cursorCheck(2, 7),
self.writeText(u'test asdf orange'),
self.selectionCheck(0, 16, 0, 0, 0),
self.displayCheckStyle(2, 7, 1, len(u"test "),
self.prg.color.get(u'text', 0)),
self.displayCheckStyle(2, 12, 1, len(u"asdf"),
self.prg.color.get(u'misspelling', 0)),
self.displayCheckStyle(2, 16, 1, len(u" orange"),
self.prg.color.get(u'text', 0)),
CTRL_Q,
u'n',
])
3 changes: 3 additions & 0 deletions unit_tests.py
Expand Up @@ -50,6 +50,7 @@
import app.unit_test_file_manager
import app.unit_test_find_window
import app.unit_test_intention
import app.unit_test_misspellings
import app.unit_test_parser
import app.unit_test_performance
import app.unit_test_prediction_window
Expand Down Expand Up @@ -93,6 +94,8 @@
app.unit_test_execute_prompt.ExecutePromptTestCases,
'intention':
app.unit_test_intention.IntentionTestCases,
'misspellings':
app.unit_test_misspellings.MisspellingsTestCases,
'parser':
app.unit_test_parser.ParserTestCases,
'performance':
Expand Down

0 comments on commit 4d62b6e

Please sign in to comment.