encoder/filename: Wrap scsu package

This commit is contained in:
Klaus Post 2021-02-11 10:41:29 +01:00 committed by Nick Craig-Wood
parent f14220ef1e
commit 5ca7f1fe87
5 changed files with 37 additions and 6 deletions

View file

@ -1,6 +1,9 @@
package filename
import "testing"
import (
"runtime"
"testing"
)
func TestDecode(t *testing.T) {
tests := []struct {
@ -117,6 +120,10 @@ func TestDecode(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
got, err := Decode(tt.encoded)
if (err != nil) != tt.wantErr {
if err != nil && err.Error() == scsuNotEnabled && runtime.Version() < "go1.13" {
t.Skip(err.Error())
return
}
if tt.encoded == "" && tt.want != "" {
proposed := Encode(tt.want)
table := decodeMap[proposed[0]] - 1