diff options
author | is <is@pkgsrc.org> | 2005-03-11 23:24:14 +0000 |
---|---|---|
committer | is <is@pkgsrc.org> | 2005-03-11 23:24:14 +0000 |
commit | bce825a666a0dfcb6874492689e80320f995f87b (patch) | |
tree | 1728a4e2feb32d310364b5bf864586ef7b624fcc /lang/sr | |
parent | ccdad65f64258aa5871a19d39e89235a3956600f (diff) | |
download | pkgsrc-bce825a666a0dfcb6874492689e80320f995f87b.tar.gz |
Add test case for pointer-string and string-pointer conversions.
Diffstat (limited to 'lang/sr')
-rw-r--r-- | lang/sr/patches/patch-bd | 14 | ||||
-rw-r--r-- | lang/sr/patches/patch-be | 34 | ||||
-rw-r--r-- | lang/sr/patches/patch-bf | 10 |
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 |