]> Cypherpunks repositories - gostls13.git/commitdiff
Fix a few tests
authorRob Pike <r@golang.org>
Mon, 9 Jun 2008 00:19:11 +0000 (17:19 -0700)
committerRob Pike <r@golang.org>
Mon, 9 Jun 2008 00:19:11 +0000 (17:19 -0700)
SVN=121614

test/char_lit.go
test/fixedbugs/bug024.go [moved from test/bugs/bug024.go with 100% similarity]
test/golden.out
test/int_lit.go

index 7943f164f184b7dfa0d0d9bddd73f6327409d96c..d061f0be4f31bd085a35910725ee8ed564c12400 100644 (file)
@@ -6,30 +6,37 @@
 
 package main
 
-func main() {
-  []int(
-    ' ',
-    'a',
-    'ä',
-    '本',
-    '\a',
-    '\b',
-    '\f',
-    '\n',
-    '\r',
-    '\t',
-    '\v',
-    '\\',
-    '\'',
-    '\"',
-    '\000',
-    '\123',
-    '\x00',
-    '\xca',
-    '\xFE',
-    '\u0123',
-    '\ubabe',
-    '\U0123ABCD',
+func main() int {
+  var i uint64 =
+    ' ' +
+    'a' +
+    'ä' +
+    '本' +
+    '\a' +
+    '\b' +
+    '\f' +
+    '\n' +
+    '\r' +
+    '\t' +
+    '\v' +
+    '\\' +
+    '\'' +
+    '\000' +
+    '\123' +
+    '\x00' +
+    '\xca' +
+    '\xFE' +
+    '\u0123' +
+    '\ubabe' +
+    '\U0123ABCD' +
     '\Ucafebabe'
-  );
+  ;
+  if '\Ucafebabe' != 0xcafebabe {
+       print "cafebabe wrong\n";
+       return 1;
+  }
+  if i != 0xcc238de1 {
+       print "number is ", i, " should be ", 0xcc238de1, "\n";
+       return 1;
+  }
 }
similarity index 100%
rename from test/bugs/bug024.go
rename to test/fixedbugs/bug024.go
index 9b3db197471ebae27f8f9b59465853ba2cc4f0a0..2c5cbc697ea44e4bd2b311e861231f6b07cee377 100644 (file)
@@ -1,9 +1,5 @@
 
 =========== ./char_lit.go
-char_lit.go:5: syntax error
-char_lit.go:17: unknown escape sequence: \
-char_lit.go:19: unknown escape sequence: "
-BUG: known to fail incorrectly
 
 =========== ./float_lit.go
 float_lit.go:5: syntax error
@@ -39,8 +35,6 @@ hello, world
 BUG: known to succeed incorrectly
 
 =========== ./int_lit.go
-int_lit.go:5: syntax error
-BUG: known to fail incorrectly
 
 =========== ./iota.go
 
@@ -52,8 +46,8 @@ BUG: known to fail incorrectly
 
 =========== ./string_lit.go
 string_lit.go:5: syntax error
-string_lit.go:12: unknown escape sequence: \
-BUG: known to fail incorrectly
+string_lit.go:12: unknown escape sequence: \ 
+BUG: known to fail incorrectly                                                                                    
 
 =========== ./switch.go
 
@@ -205,10 +199,6 @@ BUG: known to fail incorrectly
 bugs/bug023.go:20: fatal error: naddr: const <Type>I{<TypeName>110(<_t117>{},<_o119>{},{});}
 BUG: known to fail incorrectly
 
-=========== bugs/bug024.go
-bugs/bug024.go:8: unknown escape sequence: \
-BUG: erroneous errors but compiles anyway
-
 =========== bugs/bug025.go
 bugs/bug025.go:7: fatal error: dumpexportvar: oname nil: Foo
 
@@ -301,4 +291,6 @@ fixedbugs/bug007.go:7: addtyp: renaming Point/<Point>{<x><float32>FLOAT32;<y><fl
 
 =========== fixedbugs/bug021.go
 
+=========== fixedbugs/bug024.go
+
 =========== fixedbugs/bug031.go
index 9ce5fa3177edbcb264c3dbb0d6debea09eb6a5c0..28c83d9656e287ccd6f8597b73178a0942364a88 100644 (file)
@@ -6,15 +6,18 @@
 
 package main
 
-func main() {
-  []int(
-    0,
-    123,
-    0123,
-    0000,
-    0x0,
-    0x123,
-    0X0,
-    0X123
-  );
+func main() int {
+  s := 
+    0 +
+    123 +
+    0123 +
+    0000 +
+    0x0 +
+    0x123 +
+    0X0 +
+    0X123;
+  if s != 788 {
+    print "s is ", s, "; should be 788\n";
+    return 1;
+  }
 }