Skip to content

Commit

Permalink
added wordcount test
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Oct 6, 2023
1 parent 323c148 commit 8641601
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions cat_win/tests/test_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,38 @@ def test_cat_output_full_show_count(self):
self.assertIn(test_empty_path, fake_out.getvalue())
self.assertIn(test_peek, fake_out.getvalue())

@patch('cat_win.cat.sys.argv', ['<CAT>', test_file_path, '-W'])
def test_cat_output_full_show_wordcount(self):
contains = """:: 5
is: 4
Line: 3
This: 3
a: 3
!: 2
-: 2
Duplicate: 2
<: 1
>: 1
Ary: 1
Character: 1
Chars: 1
Empty: 1
N: 1
Sample: 1
Special: 1
Summation: 1
Tab: 1
Text: 1
The: 1
These: 1
are: 1
following: 1
äöüÄÖÜ: 1
∑: 1"""
with patch('cat_win.cat.sys.stdout', new=StdOutMock()) as fake_out:
cat.main()
self.assertIn(contains, fake_out.getvalue())

@patch('cat_win.cat.sys.argv',
['<CAT>', test_file_path, 'trunc=0:0', '--UNIQUE', '--b64', '-?'])
def test_cat_output_suggestions(self):
Expand Down

0 comments on commit 8641601

Please sign in to comment.