[m-rev.] For review: New test case system_sort

James Goddard goddardjames at yahoo.com
Wed Jan 14 15:08:36 AEDT 2004


Estimated hours taken: 0.5
Branches: main

Added a test case to ensure that stdin/out are redirected correctly when
invoking a system command.

tests/hard-coded/system_sort.m:
	Test program that just calls the system command "sort".

tests/hard-coded/system_sort.inp:
	Some text input.

tests/hard-coded/system_sort.exp:
	Sorted output.

tests/hard-coded/Mmakefile:
	Added system_sort to the enabled lists.

Index: Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.217
diff -u -d -r1.217 Mmakefile
--- Mmakefile	7 Jan 2004 05:47:46 -0000	1.217
+++ Mmakefile	14 Jan 2004 04:03:00 -0000
@@ -150,6 +150,7 @@
 	string_loop \
 	string_strip \
 	string_suffix_bug \
+	system_sort \
 	target_mlobjs \
 	term_io_test \
 	term_to_univ_test \
@@ -220,6 +221,7 @@
 	string_alignment \
 	string_loop \
 	string_suffix_bug \
+	system_sort \
 	target_mlobjs \
 	time_test
 
Index: system_sort.exp
===================================================================
RCS file: system_sort.exp
diff -N system_sort.exp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ system_sort.exp	13 Jan 2004 02:34:10 -0000
@@ -0,0 +1,7 @@
+a
+b
+c
+d
+e
+f
+g
Index: system_sort.inp
===================================================================
RCS file: system_sort.inp
diff -N system_sort.inp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ system_sort.inp	13 Jan 2004 02:34:07 -0000
@@ -0,0 +1,7 @@
+a
+f
+c
+b
+g
+e
+d
Index: system_sort.m
===================================================================
RCS file: system_sort.m
diff -N system_sort.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ system_sort.m	14 Jan 2004 03:14:12 -0000
@@ -0,0 +1,16 @@
+% This test case is to ensure that stdin/stdout are redirected correctly for
+% system commands.
+
+:- module system_sort.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+main -->
+	io__call_system("sort", _).
+
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list