diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ChangeLog | 7 | ||||
-rw-r--r-- | test/Makefile.am | 12 | ||||
-rw-r--r-- | test/Makefile.in | 12 | ||||
-rw-r--r-- | test/pty2.awk | 9 | ||||
-rw-r--r-- | test/pty2.ok | 2 |
5 files changed, 40 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index c64dc5bc..5799b03d 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,10 @@ +2018-01-04 Arnold D. Robbins <arnold@skeeve.com> + + Thanks to Andrew Schorr for the basics of this test. + + * Makefile.am (pty2): New test. + * pty2.awk, pty2.ok: New files. + 2018-01-02 Arnold D. Robbins <arnold@skeeve.com> Thanks to Nethox <nethox@gmail.com> for this test. diff --git a/test/Makefile.am b/test/Makefile.am index 1ec63a20..3c9f2b0c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -880,6 +880,8 @@ EXTRA_DIST = \ prtoeval.ok \ pty1.awk \ pty1.ok \ + pty2.awk \ + pty2.ok \ rand-mpfr.ok \ rand.awk \ rand.ok \ @@ -1269,7 +1271,7 @@ GAWK_EXT_TESTS = \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge \ procinfs profile0 profile1 profile2 profile3 profile4 profile5 profile6 \ - profile7 profile8 profile9 profile10 pty1 \ + profile7 profile8 profile9 profile10 pty1 pty2 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin \ rsstart1 rsstart2 rsstart3 rstest6 \ shadow shadowbuiltin sortfor sortfor2 sortu sourcesplit split_after_fpat \ @@ -2404,6 +2406,14 @@ pty1: $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ;; \ esac +pty2: + @echo $@ + @-case `uname` in \ + *[Oo][Ss]/390*) : ;; \ + *) AWKPATH="$(srcdir)" $(AWK) -f $@.awk | od -c >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ ; \ + $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ;; \ + esac + rscompat: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Makefile.in b/test/Makefile.in index 9775fd5b..482040a7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1138,6 +1138,8 @@ EXTRA_DIST = \ prtoeval.ok \ pty1.awk \ pty1.ok \ + pty2.awk \ + pty2.ok \ rand-mpfr.ok \ rand.awk \ rand.ok \ @@ -1526,7 +1528,7 @@ GAWK_EXT_TESTS = \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge \ procinfs profile0 profile1 profile2 profile3 profile4 profile5 profile6 \ - profile7 profile8 profile9 profile10 pty1 \ + profile7 profile8 profile9 profile10 pty1 pty2 \ rebuf regnul1 regnul2 regx8bit reginttrad reint reint2 rsgetline rsglstdin \ rsstart1 rsstart2 rsstart3 rstest6 \ shadow shadowbuiltin sortfor sortfor2 sortu sourcesplit split_after_fpat \ @@ -2842,6 +2844,14 @@ pty1: $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ;; \ esac +pty2: + @echo $@ + @-case `uname` in \ + *[Oo][Ss]/390*) : ;; \ + *) AWKPATH="$(srcdir)" $(AWK) -f $@.awk | od -c >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ ; \ + $(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ ;; \ + esac + rscompat: @echo $@ @AWKPATH="$(srcdir)" $(AWK) --traditional -f $@.awk "$(srcdir)/$@.in" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/pty2.awk b/test/pty2.awk new file mode 100644 index 00000000..c2eedbd0 --- /dev/null +++ b/test/pty2.awk @@ -0,0 +1,9 @@ +BEGIN { + cmd = "tr '[A-Z]' '[a-z]' 2> /dev/null" + PROCINFO[cmd, "pty"] = 1 + input = "ABCD" + print input |& cmd + cmd |& getline x + print x +# close(cmd) +} diff --git a/test/pty2.ok b/test/pty2.ok new file mode 100644 index 00000000..fb0f6221 --- /dev/null +++ b/test/pty2.ok @@ -0,0 +1,2 @@ +0000000 a b c d \n +0000005 |