tests/sorting.t @ 2cc19f841df2

Die if there are any newlines inside the task text

The `t` file format is line-based, so newlines break the file format.  We'd have
to escape them or something, but that opens a whole can of worms, and `t` is
supposed to be simple, so we'll just forbid them.

Fixes https://github.com/sjl/t/issues/26
author Steve Losh <steve@stevelosh.com>
date Sat, 11 Apr 2020 11:23:45 -0400
parents 65228e79868e
children (none)
Setup:

  $ alias xt="python $TESTDIR/../t.py --task-dir `pwd` --list test"

Add some tasks manually:

  $ cat > test << EOF
  > One | id: 1
  > Two. | id: 2
  > Zero. | id: 0
  > Three. | id: 3
  > A. | id: a
  > B. | id: b
  > AA. | id: aa
  > CC. | id: cc
  > EOF

Make sure they're sorted correctly in the output:

  $ xt
  0  - Zero.
  1  - One
  2  - Two.
  3  - Three.
  a  - A.
  aa - AA.
  b  - B.
  c  - CC.

Make sure the file hasn't actually changed:

  $ cat test
  One | id: 1
  Two. | id: 2
  Zero. | id: 0
  Three. | id: 3
  A. | id: a
  B. | id: b
  AA. | id: aa
  CC. | id: cc