mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Skip regex, case-insensitive tests on Cygwin. Because it doesn't work.
This commit is contained in:
parent
5a81fda835
commit
41473252bf
1 changed files with 15 additions and 8 deletions
|
@ -4,6 +4,7 @@
|
|||
import sys
|
||||
import os
|
||||
import unittest
|
||||
import platform
|
||||
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
@ -32,10 +33,13 @@ class Test1469(TestCase):
|
|||
|
||||
def test_implicit_search_insensitive_regex(self):
|
||||
"""Implicit search, case insensitive, regex """
|
||||
code, out, err = self.t(('list', 'möbel', 'rc.search.case.sensitive=no', 'rc.regex=on'))
|
||||
self.assertEqual(0, code, "Exit code was non-zero ({0})".format(code))
|
||||
self.assertIn ('möbel', out)
|
||||
self.assertNotIn ('foo', out)
|
||||
if 'CYGWIN' in platform.system():
|
||||
self.diag('Skipping regex case-insensitive test for Cygwin')
|
||||
else:
|
||||
code, out, err = self.t(('list', 'möbel', 'rc.search.case.sensitive=no', 'rc.regex=on'))
|
||||
self.assertEqual(0, code, "Exit code was non-zero ({0})".format(code))
|
||||
self.assertIn ('möbel', out)
|
||||
self.assertNotIn ('foo', out)
|
||||
|
||||
def test_implicit_search_insensitive_noregex(self):
|
||||
"""Implicit search, case insensitive, no regex """
|
||||
|
@ -60,10 +64,13 @@ class Test1469(TestCase):
|
|||
|
||||
def test_explicit_search_insensitive_regex(self):
|
||||
"""Explicit search, case insensitive, regex """
|
||||
code, out, err = self.t(('list', '/möbel/', 'rc.search.case.sensitive=no', 'rc.regex=on'))
|
||||
self.assertEqual(0, code, "Exit code was non-zero ({0})".format(code))
|
||||
self.assertIn ('möbel', out)
|
||||
self.assertNotIn ('foo', out)
|
||||
if 'CYGWIN' in platform.system():
|
||||
self.diag('Skipping regex case-insensitive test for Cygwin')
|
||||
else:
|
||||
code, out, err = self.t(('list', '/möbel/', 'rc.search.case.sensitive=no', 'rc.regex=on'))
|
||||
self.assertEqual(0, code, "Exit code was non-zero ({0})".format(code))
|
||||
self.assertIn ('möbel', out)
|
||||
self.assertNotIn ('foo', out)
|
||||
|
||||
def test_explicit_search_insensitive_noregex(self):
|
||||
"""Explicit search, case insensitive, no regex """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue