github.com/neugram/ng@v0.0.0-20180309130942-d472ff93d872/eval/testdata/switch9.ng (about)

     1  invalid := true
     2  cases := 0
     3  
     4  switch 1 {
     5  case 0:
     6  	panic("ERROR-1")
     7  case 1:
     8  	cases++
     9  	fallthrough
    10  case 2:
    11  	cases++
    12  	fallthrough
    13  case 3:
    14  	cases++
    15  	invalid = false
    16  case 4:
    17  	cases++
    18  	panic("ERROR-2")
    19  default:
    20  	panic("ERROR-3")
    21  }
    22  
    23  if invalid {
    24  	panic("ERROR-4")
    25  }
    26  
    27  if cases != 3 {
    28  	panic("ERROR-5")
    29  }
    30  
    31  print("OK")