github.com/lheiskan/zebrapack@v4.1.1-0.20181107023619-e955d028f9bf+incompatible/cmd/addzid/old_bambam_tests/order_test.go (about) 1 package main 2 3 import ( 4 "testing" 5 6 cv "github.com/glycerine/goconvey/convey" 7 ) 8 9 func TestOrderOfDeclIrrel(t *testing.T) { 10 11 cv.Convey("Given a golang file with a struct In1 that refers to struct In2 that is defined *later* in the file", t, func() { 12 cv.Convey("then the first capnp definition for In1Capn consistently refer to the In2Capn defined later", func() { 13 14 ex0 := ` 15 type In1 struct { 16 In2 In2 17 } 18 type In2 struct {} 19 ` 20 expect0 := `struct In1Capn { in2 @0: In2Capn; } struct In2Capn {}` 21 act0 := ExtractString2String(ex0) 22 //fmt.Printf("\n\n act0 = %#v\n expected = %#v\n", act0, expect0) 23 24 cv.So(act0, 25 ShouldStartWithModuloWhiteSpace, expect0) 26 }) 27 }) 28 }