Some checks failed
Generate check / check-changes (push) Successful in 4s
Generate check / check-changes (pull_request) Successful in 3s
Quality / check-changes (pull_request) Successful in 3s
Generate check / check-generate (push) Has been skipped
Generate check / check-generate (pull_request) Successful in 8s
Quality / tests (pull_request) Failing after 42s
39 lines
616 B
Go
39 lines
616 B
Go
package internal_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nmoniz/any2anexoj/internal"
|
|
)
|
|
|
|
func TestNature_String(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
nature internal.Nature
|
|
want string
|
|
}{
|
|
{
|
|
name: "return unknown",
|
|
want: "unknown",
|
|
},
|
|
{
|
|
name: "return G01",
|
|
nature: internal.NatureG01,
|
|
want: "G01",
|
|
},
|
|
{
|
|
name: "return G20",
|
|
nature: internal.NatureG20,
|
|
want: "G20",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
got := tt.nature.String()
|
|
if tt.want != got {
|
|
t.Fatalf("want %q but got %q", tt.want, got)
|
|
}
|
|
})
|
|
}
|
|
}
|