diff options
| author | 2022-12-04 23:25:11 -0500 | |
|---|---|---|
| committer | 2022-12-04 23:25:11 -0500 | |
| commit | b79007bb57b43b0bb5eff4aa8e5e77a782896e10 (patch) | |
| tree | 42a4b6168cc46f818465a3c25788253b2aa1b1a5 /test | |
| parent | 9f3eb7898190a9f1e131a523f37e2e53cc6c6d68 (diff) | |
| parent | 3338dfce719c999467ffe08fd45663be8190057a (diff) | |
Update upstream source from tag 'upstream/1.24.1'
Update to upstream version '1.24.1'
with Debian dir 327715c78291415f1ede99ba69c817d2264b3693
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_formatter.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_formatter.py b/test/test_formatter.py index b335332..50e55a6 100644 --- a/test/test_formatter.py +++ b/test/test_formatter.py @@ -219,6 +219,21 @@ class TestFormatter(unittest.TestCase): time.timezone = orig_timezone time.altzone = orig_altzone + def test_sort(self): + self._run_test("{l:S}" , "['a', 'b', 'c']") + self._run_test("{l:Sa}", "['a', 'b', 'c']") + self._run_test("{l:Sd}", "['c', 'b', 'a']") + self._run_test("{l:Sr}", "['c', 'b', 'a']") + + self._run_test( + "{a:S}", "[' ', 'E', 'L', 'L', 'O', 'd', 'h', 'l', 'o', 'r', 'w']") + self._run_test( + "{a:S-asc}", # starts with 'S', contains 'a' + "[' ', 'E', 'L', 'L', 'O', 'd', 'h', 'l', 'o', 'r', 'w']") + self._run_test( + "{a:Sort-reverse}", # starts with 'S', contains 'r' + "['w', 'r', 'o', 'l', 'h', 'd', 'O', 'L', 'L', 'E', ' ']") + def test_chain_special(self): # multiple replacements self._run_test("{a:Rh/C/RE/e/RL/l/}", "Cello wOrld") @@ -237,6 +252,9 @@ class TestFormatter(unittest.TestCase): # parse and format datetime self._run_test("{ds:D%Y-%m-%dT%H:%M:%S%z/%Y%m%d}", "20100101") + # sort and join + self._run_test("{a:S/J}", " ELLOdhlorw") + def test_separator(self): orig_separator = formatter._SEPARATOR try: |
