summaryrefslogtreecommitdiff
path: root/lang/sr
diff options
context:
space:
mode:
authoris <is@pkgsrc.org>2005-03-11 23:24:14 +0000
committeris <is@pkgsrc.org>2005-03-11 23:24:14 +0000
commit4c28d1b8b2c23f3fc6fabb2b2b2d174e57bf3b12 (patch)
tree1728a4e2feb32d310364b5bf864586ef7b624fcc /lang/sr
parent5a80be99a6b39580f8e619e0b8ab1f4e009de813 (diff)
downloadpkgsrc-4c28d1b8b2c23f3fc6fabb2b2b2d174e57bf3b12.tar.gz
Add test case for pointer-string and string-pointer conversions.
Diffstat (limited to 'lang/sr')
-rw-r--r--lang/sr/patches/patch-bd14
-rw-r--r--lang/sr/patches/patch-be34
-rw-r--r--lang/sr/patches/patch-bf10
3 files changed, 33 insertions, 25 deletions
diff --git a/lang/sr/patches/patch-bd b/lang/sr/patches/patch-bd
index 73ba48a2723..f152454409b 100644
--- a/lang/sr/patches/patch-bd
+++ b/lang/sr/patches/patch-bd
@@ -1,9 +1,13 @@
-$NetBSD: patch-bd,v 1.1 2005/03/09 20:38:26 is Exp $
+$NetBSD: patch-bd,v 1.2 2005/03/11 23:24:14 is Exp $
---- /dev/null 2005-03-09 09:35:26.000000000 +0100
+--- vsuite/quick/ptrstr/No_input.std.orig 2005-03-11 09:46:24.000000000 +0100
+++ vsuite/quick/ptrstr/No_input.std
-@@ -0,0 +1,4 @@
+@@ -0,0 +1,8 @@
+Testing pointer-string-pointer conversions:
+Null pointer: ==null== ; string: ==null== ; int: 0 ; pt(==null==): ==null==
-+pointer identity: true
-+string identity: true
++pointer identity: true
++string identity: true
++pointerX identity: true
++Expect invalid conversion:
++RTS abort: file pointer.sr, line 31:
++ illegal conversion: pointer("invalid")
diff --git a/lang/sr/patches/patch-be b/lang/sr/patches/patch-be
index 9d22f8e7281..cc172a4d50d 100644
--- a/lang/sr/patches/patch-be
+++ b/lang/sr/patches/patch-be
@@ -1,18 +1,16 @@
-$NetBSD: patch-be,v 1.1 2005/03/09 20:38:26 is Exp $
+$NetBSD: patch-be,v 1.2 2005/03/11 23:24:14 is Exp $
---- /dev/null 2005-03-09 09:35:53.000000000 +0100
+--- vsuite/quick/ptrstr/pointer.sr.orig 2005-03-11 09:46:25.000000000 +0100
+++ vsuite/quick/ptrstr/pointer.sr
-@@ -0,0 +1,29 @@
-+resource hello()
+@@ -0,0 +1,33 @@
++resource pointer()
+ type pt = ptr int
-+ type pa = ptr [1:2]int
-+ var foo: pa
-+ var bar: pa
-+ var baz: pa
-+ var nul: pa
++ var foo: pt
++ var bar: pt
++ var baz: pt
++ var nul: pt
+ var foos: string[20]
+ var bars: string[20]
-+ var anint: int
+
+ write("Testing pointer-string-pointer conversions:")
+
@@ -20,15 +18,21 @@ $NetBSD: patch-be,v 1.1 2005/03/09 20:38:26 is Exp $
+ write("Null pointer:", nul, "; string:", string(nul),
+ "; int:", int(nul), "; pt(==null==):", pt("==null=="))
+
-+ baz := new([1:2]int)
++ baz := new(int)
+
-+ foo := new([1:2]int)
++ foo := new(int)
+ foos:= string(foo)
+
-+ bar := pa(foos||"x")
++ bar := pt(foos)
+ bars:= string(bar)
+
-+ write("pointer identity:", foo = bar)
-+ write("string identity:", foos = bars)
++ baz := pt(foos||"X")
++
++ write("pointer identity:", foo = bar)
++ write("string identity:", foos = bars)
++ write("pointerX identity:", foo = baz)
++
++ write("Expect invalid conversion:")
++ baz := pt("invalid")
+
+end
diff --git a/lang/sr/patches/patch-bf b/lang/sr/patches/patch-bf
index cac6d4a0289..a131a90a2cd 100644
--- a/lang/sr/patches/patch-bf
+++ b/lang/sr/patches/patch-bf
@@ -1,9 +1,9 @@
-$NetBSD: patch-bf,v 1.1 2005/03/09 20:38:26 is Exp $
+$NetBSD: patch-bf,v 1.2 2005/03/11 23:24:14 is Exp $
---- /dev/null 2005-03-09 09:36:06.000000000 +0100
+--- vsuite/quick/ptrstr/Script.orig 2005-03-11 09:46:25.000000000 +0100
+++ vsuite/quick/ptrstr/Script
@@ -0,0 +1,4 @@
-+# ignatios Wed Mar 9 09:17:45 CET 2005
-+0 sr /usr/home/is/srtest/pointer.sr
-+0 run
++# ignatios Fri Mar 11 10:07:24 CET 2005
++0 sr pointer.sr
++1 run
+0 rm -rf Interfaces core *.out