view interps/cfunge/cfunge-src/tests/sysexec.b98 @ 3968:e82654a7f372

<ais523\unfoog> addquote <kmc> Sgeo: oh yeah those animated characters were built into the operating system and there was an API for them
author HackBot
date Fri, 01 Nov 2013 03:30:15 +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).