[Swift-commit] r7757 - trunk/tests/functions

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Fri Apr 4 11:53:01 CDT 2014


Author: davidk
Date: 2014-04-04 11:53:00 -0500 (Fri, 04 Apr 2014)
New Revision: 7757

Added:
   trunk/tests/functions/system_commandnotfound.setup.sh
   trunk/tests/functions/system_commandnotfound.swift
   trunk/tests/functions/system_find_arraymapper.setup.sh
   trunk/tests/functions/system_find_arraymapper.swift
   trunk/tests/functions/system_nonzero.setup.sh
   trunk/tests/functions/system_nonzero.swift
Log:
Tests for system()


Added: trunk/tests/functions/system_commandnotfound.setup.sh
===================================================================
--- trunk/tests/functions/system_commandnotfound.setup.sh	                        (rev 0)
+++ trunk/tests/functions/system_commandnotfound.setup.sh	2014-04-04 16:53:00 UTC (rev 7757)
@@ -0,0 +1 @@
+link system_find_arraymapper.setup.sh
\ No newline at end of file


Property changes on: trunk/tests/functions/system_commandnotfound.setup.sh
___________________________________________________________________
Added: svn:special
   + *

Added: trunk/tests/functions/system_commandnotfound.swift
===================================================================
--- trunk/tests/functions/system_commandnotfound.swift	                        (rev 0)
+++ trunk/tests/functions/system_commandnotfound.swift	2014-04-04 16:53:00 UTC (rev 7757)
@@ -0,0 +1,8 @@
+type file;
+
+# *_THIS-SCRIPT-SHOULD-FAIL_*
+
+string results[] = system("fdjskflsdk");
+foreach r in results {
+   tracef("%s\n", r);
+}

Added: trunk/tests/functions/system_find_arraymapper.setup.sh
===================================================================
--- trunk/tests/functions/system_find_arraymapper.setup.sh	                        (rev 0)
+++ trunk/tests/functions/system_find_arraymapper.setup.sh	2014-04-04 16:53:00 UTC (rev 7757)
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+data="fjkdlsfjlkdsjflka"
+mkdir -p data/foo_a
+mkdir -p data/foo_b
+echo $data >> data/foo_a/foo_a.txt
+echo $data >> data/foo_a/foo_b.txt
+echo $data >> data/foo_b/bar_1
+echo $data >> data/foo_b/bar_2
+echo $data >> data/data.txt


Property changes on: trunk/tests/functions/system_find_arraymapper.setup.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tests/functions/system_find_arraymapper.swift
===================================================================
--- trunk/tests/functions/system_find_arraymapper.swift	                        (rev 0)
+++ trunk/tests/functions/system_find_arraymapper.swift	2014-04-04 16:53:00 UTC (rev 7757)
@@ -0,0 +1,13 @@
+type file;
+
+app check_files (file inputs[])
+{
+   ls "data/foo_a/foo_a.txt" "data/foo_a/foo_b.txt" "data/foo_b/bar_1" "data/foo_b/bar_2" "data/data.txt";
+}
+
+file inputs[] <array_mapper; files=system("find data -type f")>;
+foreach i in inputs {
+   tracef("%s\n", filename(i));
+}
+
+check_files(inputs);

Added: trunk/tests/functions/system_nonzero.setup.sh
===================================================================
--- trunk/tests/functions/system_nonzero.setup.sh	                        (rev 0)
+++ trunk/tests/functions/system_nonzero.setup.sh	2014-04-04 16:53:00 UTC (rev 7757)
@@ -0,0 +1 @@
+link system_find_arraymapper.setup.sh
\ No newline at end of file


Property changes on: trunk/tests/functions/system_nonzero.setup.sh
___________________________________________________________________
Added: svn:special
   + *

Added: trunk/tests/functions/system_nonzero.swift
===================================================================
--- trunk/tests/functions/system_nonzero.swift	                        (rev 0)
+++ trunk/tests/functions/system_nonzero.swift	2014-04-04 16:53:00 UTC (rev 7757)
@@ -0,0 +1,8 @@
+type file;
+
+# *_THIS-SCRIPT-SHOULD-FAIL_*
+
+string results[] = system("false");
+foreach r in results {
+   tracef("%s\n", r);
+}




More information about the Swift-commit mailing list