()
| 143 | |
| 144 | |
| 145 | def test_SList(): |
| 146 | sl = text.SList(["a 11", "b 1", "a 2"]) |
| 147 | assert sl.n == "a 11\nb 1\na 2" |
| 148 | assert sl.s == "a 11 b 1 a 2" |
| 149 | assert sl.grep(lambda x: x.startswith("a")) == text.SList(["a 11", "a 2"]) |
| 150 | assert sl.fields(0) == text.SList(["a", "b", "a"]) |
| 151 | assert sl.sort(field=1, nums=True) == text.SList(["b 1", "a 2", "a 11"]) |