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

     1  package main
     2  
     3  import (
     4  	"testing"
     5  
     6  	cv "github.com/glycerine/goconvey/convey"
     7  )
     8  
     9  func TestDiffB(t *testing.T) {
    10  
    11  	cv.Convey("Given two different (possibly long, differing in whitespace) strings a and b", t, func() {
    12  		cv.Convey("then DiffB(a, b) should return the output of diff -b to consisely summarize their differences", func() {
    13  
    14  			a := `
    15  1
    16  2
    17  3
    18  4
    19  5
    20  type   s1    struct {
    21    MyInts    []int
    22  }`
    23  			b := `
    24  1
    25  2
    26  3
    27  4
    28  type s1 struct {
    29    MyInts []int
    30  }`
    31  			cv.So(string(Diffb(a, b)), cv.ShouldEqual, `6d5
    32  < 5
    33  `)
    34  
    35  		})
    36  	})
    37  }