view interps/cfunge/cfunge-src/tests/sysexec.b98 @ 9071:581584df6d82

<fizzie> revert 942e964c81c1
author HackBot
date Sun, 25 Sep 2016 20:17:31 +0000
parents 859f9b4339e6
children
line wrap: on
line source

< v ,a =  v# "echo 'Hi there (and now a ls):'; ls" 0
          > 0a"detcelfer =" >:#,_@
  > 0" :)0 eb dluohs( lavteR" >:#,_ $ . a,   v

v ,a   = "echo 'Will run: exit 2'; exit 2" 0 <
> 0" :)2 eb dluohs( lavteR" >:#,_ $ . a,v
v                                       <
>n #v=v
    >  na".gnirts htgnel orez no detcelfer = :DAB">:#,_@
          >v
      >02-w na".gnirts htgnel orez no 2- dehsup = :DOOG">:#,_@
          >> na"gnirts htgnel orez no 2- hsup t'ndid = :DAB">:#,_@

This program should ouput (on a POSIX system):
	Hi there (and now a ls):
	<list of files in current directory, as ls outputs it>

	Retval (should be 0): 0
	Will run: exit 2

	Retval (should be 2): 2
	GOOD: = pushed -2 on zero length string.
There should be no indention in the output. (It was done here for clarity.)
The blank lines should match.

The last test (value on zero length string) is implementation defined, but
cfunge is supposed to push -2. Other implementations may push other values
(even 0).