MCPcopy Create free account
hub / github.com/boombuler/barcode / Test_EncodeFunctionChars

Function Test_EncodeFunctionChars

code128/encode_test.go:37–50  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func Test_EncodeFunctionChars(t *testing.T) {
38 encFNC1 := "11110101110"
39 encFNC2 := "11110101000"
40 encFNC3 := "10111100010"
41 encFNC4 := "10111101110"
42 encStartB := "11010010000"
43 encStop := "1100011101011"
44
45 // Special Case FC1 can also be encoded to C Table therefor using 123 as suffix might have unexpected results.
46 testEncode(t, string(FNC1)+"A23", encStartB+encFNC1+"10100011000"+"11001110010"+"11001011100"+"10100011110"+encStop)
47 testEncode(t, string(FNC2)+"123", encStartB+encFNC2+"10011100110"+"11001110010"+"11001011100"+"11100010110"+encStop)
48 testEncode(t, string(FNC3)+"123", encStartB+encFNC3+"10011100110"+"11001110010"+"11001011100"+"11101000110"+encStop)
49 testEncode(t, string(FNC4)+"123", encStartB+encFNC4+"10011100110"+"11001110010"+"11001011100"+"11100011010"+encStop)
50}
51
52func Test_Unencodable(t *testing.T) {
53 if _, err := Encode(""); err == nil {

Callers

nothing calls this directly

Calls 1

testEncodeFunction · 0.85

Tested by

no test coverage detected