mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
add initial bulk run from pre-commit over all files
This commit is contained in:
parent
665aeeef61
commit
93356b39c3
418 changed files with 21354 additions and 23858 deletions
|
@ -30,6 +30,7 @@ import os
|
|||
import re
|
||||
import unittest
|
||||
import time
|
||||
|
||||
# Ensure python finds the local simpletap module
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
@ -43,6 +44,7 @@ class MetaTestSorting(MetaTest):
|
|||
Creates test_methods in the TestCase class dynamically named after the
|
||||
filter used.
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def make_function(classname, *args, **kwargs):
|
||||
_filter, expectations = args
|
||||
|
@ -82,123 +84,117 @@ class TestSorting(TestCase):
|
|||
|
||||
TESTS = (
|
||||
# Filter # Expected matches/outputs
|
||||
|
||||
# Single sort column.
|
||||
('priority-', ('(?:one.+four|four.+one).+two.+three.+zero',)),
|
||||
('priority+', ('zero.+three.+two.+(?:one.+four|four.+one)',)),
|
||||
('project-', ('(?:three.+four|four.+three).+two.+one.+zero',)),
|
||||
('project+', ('zero.+one.+two.+(?:three.+four|four.+three)',)),
|
||||
('start-', ('one.+zero', 'one.+two', 'one.+three', 'one.+four',)),
|
||||
('start+', ('one.+zero', 'one.+two', 'one.+three', 'one.+four',)),
|
||||
('due-', ('three.+(?:two.+four|four.+two).+one.+zero',)),
|
||||
('due+', ('one.+(?:two.+four|four.+two).+three.+zero',)),
|
||||
('description-', ('zero.+two.+three.+one.+four',)),
|
||||
('description+', ('four.+one.+three.+two.+zero',)),
|
||||
|
||||
("priority-", ("(?:one.+four|four.+one).+two.+three.+zero",)),
|
||||
("priority+", ("zero.+three.+two.+(?:one.+four|four.+one)",)),
|
||||
("project-", ("(?:three.+four|four.+three).+two.+one.+zero",)),
|
||||
("project+", ("zero.+one.+two.+(?:three.+four|four.+three)",)),
|
||||
(
|
||||
"start-",
|
||||
(
|
||||
"one.+zero",
|
||||
"one.+two",
|
||||
"one.+three",
|
||||
"one.+four",
|
||||
),
|
||||
),
|
||||
(
|
||||
"start+",
|
||||
(
|
||||
"one.+zero",
|
||||
"one.+two",
|
||||
"one.+three",
|
||||
"one.+four",
|
||||
),
|
||||
),
|
||||
("due-", ("three.+(?:two.+four|four.+two).+one.+zero",)),
|
||||
("due+", ("one.+(?:two.+four|four.+two).+three.+zero",)),
|
||||
("description-", ("zero.+two.+three.+one.+four",)),
|
||||
("description+", ("four.+one.+three.+two.+zero",)),
|
||||
# Two sort columns.
|
||||
('priority-,project-', ('four.+one.+two.+three.+zero',)),
|
||||
('priority-,project+', ('one.+four.+two.+three.+zero',)),
|
||||
('priority+,project-', ('zero.+three.+two.+four.+one',)),
|
||||
('priority+,project+', ('zero.+three.+two.+one.+four',)),
|
||||
|
||||
('priority-,start-', ('one.+four.+two.+three.+zero',)),
|
||||
('priority-,start+', ('one.+four.+two.+three.+zero',)),
|
||||
('priority+,start-', ('zero.+three.+two.+one.+four',)),
|
||||
('priority+,start+', ('zero.+three.+two.+one.+four',)),
|
||||
|
||||
('priority-,due-', ('four.+one.+two.+three.+zero',)),
|
||||
('priority-,due+', ('one.+four.+two.+three.+zero',)),
|
||||
('priority+,due-', ('zero.+three.+two.+four.+one',)),
|
||||
('priority+,due+', ('zero.+three.+two.+one.+four',)),
|
||||
|
||||
('priority-,description-', ('one.+four.+two.+three.+zero',)),
|
||||
('priority-,description+', ('four.+one.+two.+three.+zero',)),
|
||||
('priority+,description-', ('zero.+three.+two.+one.+four',)),
|
||||
('priority+,description+', ('zero.+three.+two.+four.+one',)),
|
||||
|
||||
('project-,priority-', ('four.+three.+two.+one.+zero',)),
|
||||
('project-,priority+', ('three.+four.+two.+one.+zero',)),
|
||||
('project+,priority-', ('zero.+one.+two.+four.+three',)),
|
||||
('project+,priority+', ('zero.+one.+two.+three.+four',)),
|
||||
|
||||
('project-,start-', ('three.+four.+two.+one.+zero',)),
|
||||
('project-,start+', ('(?:four.+three|three.+four).+two.+one.+zero',)),
|
||||
('project+,start-', ('zero.+one.+two.+three.+four',)),
|
||||
('project+,start+', ('zero.+one.+two.+(?:four.+three|three.+four)',)),
|
||||
|
||||
('project-,due-', ('three.+four.+two.+one.+zero',)),
|
||||
('project-,due+', ('four.+three.+two.+one.+zero',)),
|
||||
('project+,due-', ('zero.+one.+two.+three.+four',)),
|
||||
('project+,due+', ('zero.+one.+two.+four.+three',)),
|
||||
|
||||
('project-,description-', ('three.+four.+two.+one.+zero',)),
|
||||
('project-,description+', ('four.+three.+two.+one.+zero',)),
|
||||
('project+,description-', ('zero.+one.+two.+three.+four',)),
|
||||
('project+,description+', ('zero.+one.+two.+four.+three',)),
|
||||
|
||||
('start-,priority-', ('one.+four.+two.+three.+zero',)),
|
||||
('start-,priority+', ('one.+zero.+three.+two.+four',)),
|
||||
('start+,priority-', ('one.+four.+two.+three.+zero',)),
|
||||
('start+,priority+', ('one.+zero.+three.+two.+four',)),
|
||||
|
||||
('start-,project-', ('one.+(?:three.+four|four.+three).+two.+zero',)),
|
||||
('start-,project+', ('one.+zero.+two.+(?:three.+four|four.+three)',)),
|
||||
('start+,project-', ('one.+(?:three.+four|four.+three).+two.+zero',)),
|
||||
('start+,project+', ('one.+zero.+two.+(?:three.+four|four.+three)',)),
|
||||
|
||||
('start-,due-', ('one.+three.+(?:four.+two|two.+four).+zero',)),
|
||||
('start-,due+', ('one.+(?:four.+two|two.+four).+three.+zero',)),
|
||||
('start+,due-', ('one.+three.+(?:four.+two|two.+four).+zero',)),
|
||||
('start+,due+', ('one.+(?:four.+two|two.+four).+three.+zero',)),
|
||||
|
||||
('start-,description-', ('one.+zero.+two.+three.+four',)),
|
||||
('start-,description+', ('one.+four.+three.+two.+zero',)),
|
||||
('start+,description-', ('one.+zero.+two.+three.+four',)),
|
||||
('start+,description+', ('one.+four.+three.+two.+zero',)),
|
||||
|
||||
('due-,priority-', ('three.+four.+two.+one.+zero',)),
|
||||
('due-,priority+', ('three.+two.+four.+one.+zero',)),
|
||||
('due+,priority-', ('one.+four.+two.+three.+zero',)),
|
||||
('due+,priority+', ('one.+two.+four.+three.+zero',)),
|
||||
|
||||
('due-,project-', ('three.+four.+two.+one.+zero',)),
|
||||
('due-,project+', ('three.+two.+four.+one.+zero',)),
|
||||
('due+,project-', ('one.+four.+two.+three.+zero',)),
|
||||
('due+,project+', ('one.+two.+four.+three.+zero',)),
|
||||
|
||||
('due-,start-', ('three.+(?:four.+two|two.+four).+one.+zero',)),
|
||||
('due-,start+', ('three.+(?:four.+two|two.+four).+one.+zero',)),
|
||||
('due+,start-', ('one.+(?:four.+two|two.+four).+three.+zero',)),
|
||||
('due+,start+', ('one.+(?:four.+two|two.+four).+three.+zero',)),
|
||||
|
||||
('due-,description-', ('three.+two.+four.+one.+zero',)),
|
||||
('due-,description+', ('three.+four.+two.+one.+zero',)),
|
||||
('due+,description-', ('one.+two.+four.+three.+zero',)),
|
||||
('due+,description+', ('one.+four.+two.+three.+zero',)),
|
||||
|
||||
('description-,priority-', ('zero.+two.+three.+one.+four',)),
|
||||
('description-,priority+', ('zero.+two.+three.+one.+four',)),
|
||||
('description+,priority-', ('four.+one.+three.+two.+zero',)),
|
||||
('description+,priority+', ('four.+one.+three.+two.+zero',)),
|
||||
|
||||
('description-,project-', ('zero.+two.+three.+one.+four',)),
|
||||
('description-,project+', ('zero.+two.+three.+one.+four',)),
|
||||
('description+,project-', ('four.+one.+three.+two.+zero',)),
|
||||
('description+,project+', ('four.+one.+three.+two.+zero',)),
|
||||
|
||||
('description-,start-', ('zero.+two.+three.+one.+four',)),
|
||||
('description-,start+', ('zero.+two.+three.+one.+four',)),
|
||||
('description+,start-', ('four.+one.+three.+two.+zero',)),
|
||||
('description+,start+', ('four.+one.+three.+two.+zero',)),
|
||||
|
||||
('description-,due-', ('zero.+two.+three.+one.+four',)),
|
||||
('description-,due+', ('zero.+two.+three.+one.+four',)),
|
||||
('description+,due-', ('four.+one.+three.+two.+zero',)),
|
||||
('description+,due+', ('four.+one.+three.+two.+zero',)),
|
||||
|
||||
("priority-,project-", ("four.+one.+two.+three.+zero",)),
|
||||
("priority-,project+", ("one.+four.+two.+three.+zero",)),
|
||||
("priority+,project-", ("zero.+three.+two.+four.+one",)),
|
||||
("priority+,project+", ("zero.+three.+two.+one.+four",)),
|
||||
("priority-,start-", ("one.+four.+two.+three.+zero",)),
|
||||
("priority-,start+", ("one.+four.+two.+three.+zero",)),
|
||||
("priority+,start-", ("zero.+three.+two.+one.+four",)),
|
||||
("priority+,start+", ("zero.+three.+two.+one.+four",)),
|
||||
("priority-,due-", ("four.+one.+two.+three.+zero",)),
|
||||
("priority-,due+", ("one.+four.+two.+three.+zero",)),
|
||||
("priority+,due-", ("zero.+three.+two.+four.+one",)),
|
||||
("priority+,due+", ("zero.+three.+two.+one.+four",)),
|
||||
("priority-,description-", ("one.+four.+two.+three.+zero",)),
|
||||
("priority-,description+", ("four.+one.+two.+three.+zero",)),
|
||||
("priority+,description-", ("zero.+three.+two.+one.+four",)),
|
||||
("priority+,description+", ("zero.+three.+two.+four.+one",)),
|
||||
("project-,priority-", ("four.+three.+two.+one.+zero",)),
|
||||
("project-,priority+", ("three.+four.+two.+one.+zero",)),
|
||||
("project+,priority-", ("zero.+one.+two.+four.+three",)),
|
||||
("project+,priority+", ("zero.+one.+two.+three.+four",)),
|
||||
("project-,start-", ("three.+four.+two.+one.+zero",)),
|
||||
("project-,start+", ("(?:four.+three|three.+four).+two.+one.+zero",)),
|
||||
("project+,start-", ("zero.+one.+two.+three.+four",)),
|
||||
("project+,start+", ("zero.+one.+two.+(?:four.+three|three.+four)",)),
|
||||
("project-,due-", ("three.+four.+two.+one.+zero",)),
|
||||
("project-,due+", ("four.+three.+two.+one.+zero",)),
|
||||
("project+,due-", ("zero.+one.+two.+three.+four",)),
|
||||
("project+,due+", ("zero.+one.+two.+four.+three",)),
|
||||
("project-,description-", ("three.+four.+two.+one.+zero",)),
|
||||
("project-,description+", ("four.+three.+two.+one.+zero",)),
|
||||
("project+,description-", ("zero.+one.+two.+three.+four",)),
|
||||
("project+,description+", ("zero.+one.+two.+four.+three",)),
|
||||
("start-,priority-", ("one.+four.+two.+three.+zero",)),
|
||||
("start-,priority+", ("one.+zero.+three.+two.+four",)),
|
||||
("start+,priority-", ("one.+four.+two.+three.+zero",)),
|
||||
("start+,priority+", ("one.+zero.+three.+two.+four",)),
|
||||
("start-,project-", ("one.+(?:three.+four|four.+three).+two.+zero",)),
|
||||
("start-,project+", ("one.+zero.+two.+(?:three.+four|four.+three)",)),
|
||||
("start+,project-", ("one.+(?:three.+four|four.+three).+two.+zero",)),
|
||||
("start+,project+", ("one.+zero.+two.+(?:three.+four|four.+three)",)),
|
||||
("start-,due-", ("one.+three.+(?:four.+two|two.+four).+zero",)),
|
||||
("start-,due+", ("one.+(?:four.+two|two.+four).+three.+zero",)),
|
||||
("start+,due-", ("one.+three.+(?:four.+two|two.+four).+zero",)),
|
||||
("start+,due+", ("one.+(?:four.+two|two.+four).+three.+zero",)),
|
||||
("start-,description-", ("one.+zero.+two.+three.+four",)),
|
||||
("start-,description+", ("one.+four.+three.+two.+zero",)),
|
||||
("start+,description-", ("one.+zero.+two.+three.+four",)),
|
||||
("start+,description+", ("one.+four.+three.+two.+zero",)),
|
||||
("due-,priority-", ("three.+four.+two.+one.+zero",)),
|
||||
("due-,priority+", ("three.+two.+four.+one.+zero",)),
|
||||
("due+,priority-", ("one.+four.+two.+three.+zero",)),
|
||||
("due+,priority+", ("one.+two.+four.+three.+zero",)),
|
||||
("due-,project-", ("three.+four.+two.+one.+zero",)),
|
||||
("due-,project+", ("three.+two.+four.+one.+zero",)),
|
||||
("due+,project-", ("one.+four.+two.+three.+zero",)),
|
||||
("due+,project+", ("one.+two.+four.+three.+zero",)),
|
||||
("due-,start-", ("three.+(?:four.+two|two.+four).+one.+zero",)),
|
||||
("due-,start+", ("three.+(?:four.+two|two.+four).+one.+zero",)),
|
||||
("due+,start-", ("one.+(?:four.+two|two.+four).+three.+zero",)),
|
||||
("due+,start+", ("one.+(?:four.+two|two.+four).+three.+zero",)),
|
||||
("due-,description-", ("three.+two.+four.+one.+zero",)),
|
||||
("due-,description+", ("three.+four.+two.+one.+zero",)),
|
||||
("due+,description-", ("one.+two.+four.+three.+zero",)),
|
||||
("due+,description+", ("one.+four.+two.+three.+zero",)),
|
||||
("description-,priority-", ("zero.+two.+three.+one.+four",)),
|
||||
("description-,priority+", ("zero.+two.+three.+one.+four",)),
|
||||
("description+,priority-", ("four.+one.+three.+two.+zero",)),
|
||||
("description+,priority+", ("four.+one.+three.+two.+zero",)),
|
||||
("description-,project-", ("zero.+two.+three.+one.+four",)),
|
||||
("description-,project+", ("zero.+two.+three.+one.+four",)),
|
||||
("description+,project-", ("four.+one.+three.+two.+zero",)),
|
||||
("description+,project+", ("four.+one.+three.+two.+zero",)),
|
||||
("description-,start-", ("zero.+two.+three.+one.+four",)),
|
||||
("description-,start+", ("zero.+two.+three.+one.+four",)),
|
||||
("description+,start-", ("four.+one.+three.+two.+zero",)),
|
||||
("description+,start+", ("four.+one.+three.+two.+zero",)),
|
||||
("description-,due-", ("zero.+two.+three.+one.+four",)),
|
||||
("description-,due+", ("zero.+two.+three.+one.+four",)),
|
||||
("description+,due-", ("four.+one.+three.+two.+zero",)),
|
||||
("description+,due+", ("four.+one.+three.+two.+zero",)),
|
||||
# Four sort columns.
|
||||
('start+,project+,due+,priority+', ('one.+zero.+two.+four.+three',)),
|
||||
('project+,due+,priority+,start+', ('zero.+one.+two.+four.+three',)),
|
||||
("start+,project+,due+,priority+", ("one.+zero.+two.+four.+three",)),
|
||||
("project+,due+,priority+,start+", ("zero.+one.+two.+four.+three",)),
|
||||
)
|
||||
|
||||
|
||||
|
@ -243,8 +239,8 @@ class TestBug438(TestCase):
|
|||
("entry-", ("one newer.+one older",)),
|
||||
("start+", ("two older.+two newer",)),
|
||||
("start-", ("two newer.+two older",)),
|
||||
("end+", ("three older.+three newer",)),
|
||||
("end-", ("three newer.+three older",)),
|
||||
("end+", ("three older.+three newer",)),
|
||||
("end-", ("three newer.+three older",)),
|
||||
}
|
||||
|
||||
|
||||
|
@ -258,13 +254,17 @@ class TestSortNone(TestCase):
|
|||
self.t("add two")
|
||||
self.t("add three")
|
||||
code, out, err = self.t("_get 1.uuid 2.uuid 3.uuid")
|
||||
uuid1, uuid2, uuid3 = out.strip().split(' ')
|
||||
code, out, err = self.t("%s %s %s list rc.report.list.sort:none rc.report.list.columns:id,description rc.report.list.labels:id,desc" % (uuid2, uuid3, uuid1))
|
||||
self.assertRegex(out, ' 2 two\n 3 three\n 1 one')
|
||||
uuid1, uuid2, uuid3 = out.strip().split(" ")
|
||||
code, out, err = self.t(
|
||||
"%s %s %s list rc.report.list.sort:none rc.report.list.columns:id,description rc.report.list.labels:id,desc"
|
||||
% (uuid2, uuid3, uuid1)
|
||||
)
|
||||
self.assertRegex(out, " 2 two\n 3 three\n 1 one")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
||||
# vim: ai sts=4 et sw=4 ft=python
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue