docuemntation and refacotring
[pspp] / tests / output / ascii.at
index b4de68808ee8d2f9f985be211e93e5aab0087058..1ca75106675c500be63423800c99531e8b970457 100644 (file)
@@ -1,3 +1,19 @@
+dnl PSPP - a program for statistical analysis.
+dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl
 AT_BANNER([ASCII driver -- rendering corner cases])
 
 AT_SETUP([ASCII driver overwriting single-width text])
@@ -67,7 +83,7 @@ AT_DATA([input], [dnl
 0 18 1 か
 4 18 1 くけ
 ])
-AT_CHECK([render-test --draw-mode --emph=none input], [0], [dnl
+AT_CHECK([ascii-test --emph=none input], [0], [dnl
 aBCD
 eFGH
 iJKL
@@ -88,7 +104,7 @@ kaきくけ
 かkiくけko
 かkiくけko
 ])
-AT_CHECK([render-test --draw-mode --emph=bold input], [0], [dnl
+AT_CHECK([ascii-test --emph=bold input], [0], [dnl
 aBCD
 eF\bFG\bGH\bH
 i\biJKL
@@ -109,7 +125,7 @@ k\bka\baき\bきく\bくけ\b
 かk\bki\biくけk\bko\bo
 か\bかk\bki\biく\bくけ\bけk\bko\bo
 ])
-AT_CHECK([render-test --draw-mode --emph=underline input], [0], [dnl
+AT_CHECK([ascii-test --emph=underline input], [0], [dnl
 aBCD
 e_\bF_\bG_\bH
 _\biJKL
@@ -263,7 +279,7 @@ AT_DATA([input], [dnl
 1 38 1 a
 5 38 1 kuke
 ])
-AT_CHECK([render-test --draw-mode --emph=none input], [0], [dnl
+AT_CHECK([ascii-test --emph=none input], [0], [dnl
 あきくけ
 あきくけ
 あきくけ
@@ -304,7 +320,7 @@ kaいkukeお
 ?aい?kuke?さ
 ?aい?kuke?さ
 ])
-AT_CHECK([render-test --draw-mode --emph=bold input], [0], [dnl
+AT_CHECK([ascii-test --emph=bold input], [0], [dnl
 あきくけ
 あき\bきく\bくけ\b
 あ\bあきくけ
@@ -345,7 +361,7 @@ k\bka\baい\bいk\bku\buk\bke\beお\b
 ?aい\bい?kuke?さ\b
 ?a\baい\bい?k\bku\buk\bke\be?さ\b
 ])
-AT_CHECK([render-test --draw-mode --emph=underline input], [0], [dnl
+AT_CHECK([ascii-test --emph=underline input], [0], [dnl
 あきくけ
 あ_\bき_\bく_\b
 _\bあきくけ
@@ -455,7 +471,7 @@ AT_DATA([input], [dnl
 0 18 1 à
 2 18 1 îo̧ũ
 ])
-AT_CHECK([render-test --draw-mode --emph=none input], [0], [dnl
+AT_CHECK([ascii-test --emph=none input], [0], [dnl
 àxyz
 àxyz
 àxyz
@@ -476,7 +492,7 @@ àeîo̧ũy
 àeîo̧ũy
 àeîo̧ũy
 ])
-AT_CHECK([render-test --draw-mode --emph=bold input], [0], [dnl
+AT_CHECK([ascii-test --emph=bold input], [0], [dnl
 àxyz
 àx\bxy\byz\bz
 a\bàxyz
@@ -497,7 +513,7 @@ a\bàei\bîo\bo̧u\bũy
 àe\beîo̧ũy\by
 a\bàe\bei\bîo\bo̧u\bũy\by
 ])
-AT_CHECK([render-test --draw-mode --emph=underline input], [0], [dnl
+AT_CHECK([ascii-test --emph=underline input], [0], [dnl
 àxyz
 à_\bx_\by_\bz
 _\bàxyz
@@ -534,20 +550,20 @@ set-length 2 2
 set-length 3 1
 set-length 4 0
 
+0 5 0 あい
 0 6 0 あい
 0 7 0 あい
 0 8 0 あい
 0 9 0 あい
 0 10 0 あい
-0 11 0 あい
-set-length 6 5
-set-length 7 4
-set-length 8 3
-set-length 9 2
-set-length 10 1
-set-length 11 0
+set-length 5 5
+set-length 6 4
+set-length 7 3
+set-length 8 2
+set-length 9 1
+set-length 10 0
 ])
-AT_CHECK([render-test --draw-mode input], [0], [dnl
+AT_CHECK([ascii-test input], [0], [dnl
 àéî
 àéî
 àé
@@ -561,26 +577,6 @@ à
 ])
 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.
@@ -604,7 +600,7 @@ DATA LIST LIST /x * y * a (a23).
 Reading free-form data from INLINE.
 +--------+------+
 |Variable|Format|
-#========#======#
++--------+------+
 |x       |F8.0  |
 |y       |F8.0  |
 |a       |A23   |
@@ -644,12 +640,50 @@ DESCRIPTIVES X.
 
 
 AT_CHECK([pspp -O box=unicode uc.sps], [0], [dnl
-Valid cases = 3; cases with missing value(s) = 0.
-╭────────╥─┬──────┬───────┬───────┬───────╮
-│Variable║N│ Mean │Std Dev│Minimum│Maximum│
-╞════════╬═╪══════╪═══════╪═══════╪═══════╡
-│x       ║3│2.0000│ 1.0000│ 1.0000│ 3.0000│
-╰────────╨─┴──────┴───────┴───────┴───────╯
+                 Descriptive Statistics
+╭────────────────────┬─┬──────┬───────┬───────┬───────╮
+│                    │N│ Mean │Std Dev│Minimum│Maximum│
+├────────────────────┼─┼──────┼───────┼───────┼───────┤
+│x                   │3│2.0000│ 1.0000│ 1.0000│ 3.0000│
+│Valid N (listwise)  │3│      │       │       │       │
+│Missing N (listwise)│0│      │       │       │       │
+╰────────────────────┴─┴──────┴───────┴───────┴───────╯
+])
+
+AT_CLEANUP
+
+AT_SETUP([ASCII crash on empty line])
+
+AT_DATA([print.sps], [dnl
+data list notable /x y 1-2.
+begin data.
+12
+end data.
+
+print.
+
+execute.
 ])
 
+AT_CHECK([pspp print.sps], [0], [ignore])
+
+AT_CLEANUP
+
+
+
+dnl A crash has been observed when the first character
+dnl of a string is U+0008
+AT_SETUP([ASCII crash on non-printables])
+
+AT_DATA([nonprint.sps], [dnl
+DATA LIST FREE /s8 (a8).
+BEGIN DATA.
+xxxxxx zzz  \ba qqq
+END DATA.
+
+LIST.
+])
+
+AT_CHECK([pspp nonprint.sps], [0], [ignore])
+
 AT_CLEANUP