github.com/keysonZZZ/kmg@v0.0.0-20151121023212-05317bfd7d39/encoding/kmgYaml/goyaml_test.go (about)

     1  package kmgYaml
     2  
     3  import "testing"
     4  import "github.com/bronze1man/kmg/kmgTest"
     5  
     6  func TestUnicodeMarshal(ot *testing.T) {
     7  	t := kmgTest.NewTestTools(ot)
     8  	testCaseTable := []struct {
     9  		in  string
    10  		out string
    11  	}{
    12  		{
    13  			`中文`, "中文\n",
    14  		},
    15  	}
    16  	for _, testCase := range testCaseTable {
    17  		outByte, err := Marshal(testCase.in)
    18  		t.Equal(err, nil)
    19  		t.Equal(string(outByte), testCase.out)
    20  	}
    21  }