ebml-go/datatype_test.go
Atsushi Watanabe 910e435dc6
Use map in stringer (#117)
* master
    goos: linux
    goarch: amd64
    pkg: github.com/at-wat/ebml-go
    BenchmarkMarshal-4     	10000000	      5248 ns/op	    1728 B/op	      51 allocs/op
    BenchmarkUnmarshal-4   	10000000	      4261 ns/op	     360 B/op	      43 allocs/op

* this
    goos: linux
    goarch: amd64
    pkg: github.com/at-wat/ebml-go
    BenchmarkMarshal-4     	10000000	      5340 ns/op	    1728 B/op	      51 allocs/op
    BenchmarkUnmarshal-4   	10000000	      4311 ns/op	     360 B/op	      43 allocs/op
2019-12-28 13:19:52 +09:00

26 lines
828 B
Go

// Copyright 2019 The ebml-go authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package ebml
import (
"testing"
)
func TestDataType_String(t *testing.T) {
invalid := DataType(-1)
if invalid.String() != "unknown" {
t.Errorf("Invalid DataType string should be 'unknown', got '%s'", invalid.String())
}
}