AT_BANNER([ASCII driver -- rendering corner cases])

AT_SETUP([ASCII driver overwriting single-width text])
AT_KEYWORDS([render rendering])
AT_DATA([input], [dnl
## overwriting rest of line
# plain
0 0 0 abc
1 0 0 BCD
# emphasized over plain
0 1 0 efg
1 1 1 FGH
# plain over emphasized
0 2 1 ijk
1 2 0 JKL
# emphasized over emphasized
0 3 1 mno
1 3 1 NOP

## overwriting partial line
# plain
0 5 0 abcdef
0 5 0 A
2 5 0 CDE
# emphasized over plain
0 6 0 ghijkl
0 6 1 G
2 6 1 IJK
# plain over emphasized
0 7 1 mnopqr
0 7 0 M
2 7 0 OPQ
# emphasized over emphasized
0 8 1 stuvwx
0 8 1 S
2 8 1 UVW

## overwriting rest of line with double-width characters
# plain
0 10 0 kakiku
2 10 0 きくけ
# emphasized over plain
0 11 0 kakiku
2 11 1 きくけ
# plain over emphasized
0 12 1 kakiku
2 12 0 きくけ
# emphasized over emphasized
0 13 1 kakiku
2 13 1 きくけ

## overwriting partial line with double-width characters
# plain
0 15 0 kakikukeko
0 15 0 か
4 15 0 くけ
# emphasized over plain
0 16 0 kakikukeko
0 16 1 か
4 16 1 くけ
# plain over emphasized
0 17 1 kakikukeko
0 17 0 か
4 17 0 くけ
# emphasized over emphasized
0 18 1 kakikukeko
0 18 1 か
4 18 1 くけ
])
AT_CHECK([render-test --draw-mode --emph=none input], [0], [dnl
aBCD
eFGH
iJKL
mNOP

AbCDEf
GhIJKl
MnOPQr
StUVWx

kaきくけ
kaきくけ
kaきくけ
kaきくけ

かkiくけko
かkiくけko
かkiくけko
かkiくけko
])
AT_CHECK([render-test --draw-mode --emph=bold input], [0], [dnl
aBCD
eFGH
iJKL
mNOP

AbCDEf
GhIJKl
MnOPQr
StUVWx

kaきくけ
kaきくけ
kaきくけ
kaきくけ

かkiくけko
かkiくけko
かkiくけko
かkiくけko
])
AT_CHECK([render-test --draw-mode --emph=underline input], [0], [dnl
aBCD
eFGH
iJKL
mNOP

AbCDEf
GhIJKl
MnOPQr
StUVWx

kaきくけ
kaきくけ
kaきくけ
kaきくけ

かkiくけko
かkiくけko
かkiくけko
かkiくけko
])
AT_CLEANUP

AT_SETUP([ASCII driver overwriting double-width text])
AT_KEYWORDS([render rendering])
AT_DATA([input], [dnl
## overwrite rest of line, aligned double-width over double-width
# plain
0 0 0 あいう
2 0 0 きくけ
# emphasized over plain
0 1 0 あいう
2 1 1 きくけ
# plain over emphasized
0 2 1 あいう
2 2 0 きくけ
# emphasized over emphasized
0 3 1 あいう
2 3 1 きくけ

## overwrite rest of line, misaligned double-width over double-width
# plain
0 5 0 あいう
3 5 0 きくけ
# emphasized over plain
0 6 0 あいう
3 6 1 きくけ
# plain over emphasized
0 7 1 あいう
3 7 0 きくけ
# emphasized over emphasized
0 8 1 あいう
3 8 1 きくけ

## overwrite partial line, aligned double-width over double-width
# plain
0 10 0 あいうえお
0 10 0 か
4 10 0 くけ
# emphasized over plain
0 11 0 あいうえお
0 11 1 か
4 11 1 くけ
# plain over emphasized
0 12 1 あいうえお
0 12 0 か
4 12 0 くけ
# emphasized over emphasized
0 13 1 あいうえお
0 13 1 か
4 13 1 くけ

## overwrite partial line, misaligned double-width over double-width
# plain
0 15 0 あいうえおさ
1 15 0 か
5 15 0 くけ
# emphasized over plain
0 16 0 あいうえおさ
1 16 1 か
5 16 1 くけ
# plain over emphasized
0 17 1 あいうえおさ
1 17 0 か
5 17 0 くけ
# emphasized over emphasized
0 18 1 あいうえおさ
1 18 1 か
5 18 1 くけ

## overwrite rest of line, aligned single-width over double-width
# plain
0 20 0 あいう
2 20 0 kikuko
# emphasized over plain
0 21 0 あいう
2 21 1 kikuko
# plain over emphasized
0 22 1 あいう
2 22 0 kikuko
# emphasized over emphasized
0 23 1 あいう
2 23 1 kikuko

## overwrite rest of line, misaligned single-width over double-width
# plain
0 25 0 あいう
3 25 0 kikuko
# emphasized over plain
0 26 0 あいう
3 26 1 kikuko
# plain over emphasized
0 27 1 あいう
3 27 0 kikuko
# emphasized over emphasized
0 28 1 あいう
3 28 1 kikuko

## overwrite partial line, aligned single-width over double-width
# plain
0 30 0 あいうえお
0 30 0 ka
4 30 0 kuke
# emphasized over plain
0 31 0 あいうえお
0 31 1 ka
4 31 1 kuke
# plain over emphasized
0 32 1 あいうえお
0 32 0 ka
4 32 0 kuke
# emphasized over emphasized
0 33 1 あいうえお
0 33 1 ka
4 33 1 kuke

## overwrite partial line, misaligned single-width over double-width
# plain
0 35 0 あいうえおさ
1 35 0 a
5 35 0 kuke
# emphasized over plain
0 36 0 あいうえおさ
1 36 1 a
5 36 1 kuke
# plain over emphasized
0 37 1 あいうえおさ
1 37 0 a
5 37 0 kuke
# emphasized over emphasized
0 38 1 あいうえおさ
1 38 1 a
5 38 1 kuke
])
AT_CHECK([render-test --draw-mode --emph=none input], [0], [dnl
あきくけ
あきくけ
あきくけ
あきくけ

あ?きくけ
あ?きくけ
あ?きくけ
あ?きくけ

かいくけお
かいくけお
かいくけお
かいくけお

?か??くけ?さ
?か??くけ?さ
?か??くけ?さ
?か??くけ?さ

あkikuko
あkikuko
あkikuko
あkikuko

あ?kikuko
あ?kikuko
あ?kikuko
あ?kikuko

kaいkukeお
kaいkukeお
kaいkukeお
kaいkukeお

?aい?kuke?さ
?aい?kuke?さ
?aい?kuke?さ
?aい?kuke?さ
])
AT_CHECK([render-test --draw-mode --emph=bold input], [0], [dnl
あきくけ
あきくけ
あきくけ
あきくけ

あ?きくけ
あ?きくけ
あ?きくけ
あ?きくけ

かいくけお
かいくけお
かいくけお
かいくけお

?か??くけ?さ
?か??くけ?さ
?か??くけ?さ
?か??くけ?さ

あkikuko
あkikuko
あkikuko
あkikuko

あ?kikuko
あ?kikuko
あ?kikuko
あ?kikuko

kaいkukeお
kaいkukeお
kaいkukeお
kaいkukeお

?aい?kuke?さ
?aい?kuke?さ
?aい?kuke?さ
?aい?kuke?さ
])
AT_CHECK([render-test --draw-mode --emph=underline input], [0], [dnl
あきくけ
あきくけ
あきくけ
あきくけ

あ?きくけ
あ?きくけ
あ?きくけ
あ?きくけ

かいくけお
かいくけお
かいくけお
かいくけお

?か??くけ?さ
?か??くけ?さ
?か??くけ?さ
?か??くけ?さ

あkikuko
あkikuko
あkikuko
あkikuko

あ?kikuko
あ?kikuko
あ?kikuko
あ?kikuko

kaいkukeお
kaいkukeお
kaいkukeお
kaいkukeお

?aい?kuke?さ
?aい?kuke?さ
?aい?kuke?さ
?aい?kuke?さ
])
AT_CLEANUP

AT_SETUP([ASCII driver overwriting combining characters])
AT_KEYWORDS([render rendering])
AT_DATA([input], [dnl
## overwriting rest of line, ordinary over combining
# plain
0 0 0 àéî
1 0 0 xyz
# emphasized over plain
0 1 0 àéî
1 1 1 xyz
# plain over emphasized
0 2 1 àéî
1 2 0 xyz
# emphasized over emphasized
0 3 1 àéî
1 3 1 xyz

## overwriting rest of line, combining over ordinary
# plain
0 5 0 xyz
1 5 0 àéî
# emphasized over plain
0 6 0 xyz
1 6 1 àéî
# plain over emphasized
0 7 1 xyz
1 7 0 àéî
# emphasized over emphasized
0 8 1 xyz
1 8 1 àéî

## overwriting partial line, ordinary over combining
# plain
0 10 0 àéîo̧ũẙ
0 10 0 a
2 10 0 iou
# emphasized over plain
0 11 0 àéîo̧ũẙ
0 11 1 a
2 11 1 iou
# plain over emphasized
0 12 1 àéîo̧ũẙ
0 12 0 a
2 12 0 iou
# emphasized over emphasized
0 13 1 àéîo̧ũẙ
0 13 1 a
2 13 1 iou

## overwriting partial line, combining over ordinary
# plain
0 15 0 aeiouy
0 15 0 à
2 15 0 îo̧ũ
# emphasized over plain
0 16 0 aeiouy
0 16 1 à
2 16 1 îo̧ũ
# plain over emphasized
0 17 1 aeiouy
0 17 0 à
2 17 0 îo̧ũ
# emphasized over emphasized
0 18 1 aeiouy
0 18 1 à
2 18 1 îo̧ũ
])
AT_CHECK([render-test --draw-mode --emph=none input], [0], [dnl
àxyz
àxyz
àxyz
àxyz

xàéî
xàéî
xàéî
xàéî

aéiouẙ
aéiouẙ
aéiouẙ
aéiouẙ

àeîo̧ũy
àeîo̧ũy
àeîo̧ũy
àeîo̧ũy
])
AT_CHECK([render-test --draw-mode --emph=bold input], [0], [dnl
àxyz
àxyz
àxyz
àxyz

xàéî
xàéî
xàéî
xàéî

aéiouẙ
aéiouẙ
aéiouẙ
aéiouẙ

àeîo̧ũy
àeîo̧ũy
àeîo̧ũy
àeîo̧ũy
])
AT_CHECK([render-test --draw-mode --emph=underline input], [0], [dnl
àxyz
àxyz
àxyz
àxyz

xàéî
xàéî
xàéî
xàéî

aéiouẙ
aéiouẙ
aéiouẙ
aéiouẙ

àeîo̧ũy
àeîo̧ũy
àeîo̧ũy
àeîo̧ũy
])
AT_CLEANUP

AT_SETUP([ASCII driver Unicode box characters])
AT_KEYWORDS([render rendering])
AT_DATA([input], [3 3
1*2 @abc
2*1 @d\ne\nf
2*1 @g\nh\ni
@j
1*2 @klm
])
AT_CHECK([render-test --box=unicode input], [0], [dnl
╭───┬─╮
│abc│d│
├─┬─┤e│
│g│j│f│
│h├─┴─┤
│i│klm│
╰─┴───╯
])
AT_CLEANUP

AT_SETUP([ASCII driver syntax printback])
AT_DATA([ascii.sps], [dnl
SET PRINTBACK=ON.
DATA LIST LIST /x * y * a (a23).
BEGIN DATA.
1 11 One
2 22 Two
3 33 Three
END DATA.

REGRESSION
/VARIABLES= a
/DEPENDENT= x y
/STATISTICS=COEFF R ANOVA.
])
AT_CHECK([pspp ascii.sps], [0], [dnl
SET PRINTBACK=ON.

DATA LIST LIST /x * y * a (a23).

Reading free-form data from INLINE.
+--------+------+
|Variable|Format|
#========#======#
|x       |F8.0  |
|y       |F8.0  |
|a       |A23   |
+--------+------+

BEGIN DATA.
1 11 One
2 22 Two
3 33 Three
END DATA.

REGRESSION
/VARIABLES= a

ascii.sps:11: warning: REGRESSION: a is not a numeric variable.  It will not be
included in the variable list.

/DEPENDENT= x y
/STATISTICS=COEFF R ANOVA.
])

AT_CLEANUP
