~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/go/parser/short_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
        `package p;`,
14
14
        `package p; import "fmt"; func f() { fmt.Println("Hello, World!") };`,
15
15
        `package p; func f() { if f(T{}) {} };`,
16
 
        `package p; func f() { _ = (<-chan int)(x) };`,
17
 
        `package p; func f() { _ = (<-chan <-chan int)(x) };`,
 
16
        `package p; func f() { _ = <-chan int(nil) };`,
 
17
        `package p; func f() { _ = (<-chan int)(nil) };`,
 
18
        `package p; func f() { _ = (<-chan <-chan int)(nil) };`,
 
19
        `package p; func f() { _ = <-chan <-chan <-chan <-chan <-int(nil) };`,
18
20
        `package p; func f(func() func() func());`,
19
21
        `package p; func f(...T);`,
20
22
        `package p; func f(float, ...int);`,
64
66
        `package p; var a = []int{[ /* ERROR "expected expression" */ ]int};`,
65
67
        `package p; var a = ( /* ERROR "expected expression" */ []int);`,
66
68
        `package p; var a = a[[ /* ERROR "expected expression" */ ]int:[]int];`,
67
 
        `package p; var a = <-  /* ERROR "expected expression" */ chan int;`,
68
 
        `package p; func f() { select { case _ <- chan  /* ERROR "expected expression" */ int: } };`,
 
69
        `package p; var a = <- /* ERROR "expected expression" */ chan int;`,
 
70
        `package p; func f() { select { case _ <- chan /* ERROR "expected expression" */ int: } };`,
 
71
        `package p; func f() { _ = (<-<- /* ERROR "expected 'chan'" */ chan int)(nil) };`,
 
72
        `package p; func f() { _ = (<-chan<-chan<-chan<-chan<-chan<- /* ERROR "expected channel type" */ int)(nil) };`,
 
73
        `package p; func f() { var t []int; t /* ERROR "expected identifier on left side of :=" */ [0] := 0 };`,
 
74
        `package p; func f() { if x := g(); x = /* ERROR "expected '=='" */ 0 {}};`,
 
75
        `package p; func f() { _ = x = /* ERROR "expected '=='" */ 0 {}};`,
 
76
        `package p; func f() { _ = 1 == func()int { var x bool; x = x = /* ERROR "expected '=='" */ true; return x }() };`,
69
77
}
70
78
 
71
79
func TestInvalid(t *testing.T) {