github.com/chrislusf/greenpack@v3.7.1-0.20170911073826-ad5bd10b7c47+incompatible/cmd/addzid/old_bambam_tests/skip_test.go (about)

     1  package main
     2  
     3  import (
     4  	"testing"
     5  
     6  	cv "github.com/glycerine/goconvey/convey"
     7  )
     8  
     9  func TestZidSkip(t *testing.T) {
    10  
    11  	cv.Convey("Given go: type Hi struct { A int `zid:\"skip\"`; B int  } ", t, func() {
    12  		cv.Convey("then addzid should skip the A field and any negative numbered zid tags", func() {
    13  
    14  			in1 := " type Hi struct { A int `zid:\"skip\"`; B int; C int `zid:\"-1\"`; D int `zid:\"-2\"`  } "
    15  
    16  			expect1 := `
    17  struct HiCapn { b  @0:   Int64; } 
    18  `
    19  
    20  			cv.So(ExtractString2String(in1), ShouldStartWithModuloWhiteSpace, expect1)
    21  		})
    22  	})
    23  }