add test suite
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestContainsOption_present(t *testing.T) {
|
||||
opts := []string{"force", "vertical-slices", "omit-test"}
|
||||
if !containsOption(opts, "vertical-slices") {
|
||||
t.Error("containsOption failed to find present option")
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainsOption_absent(t *testing.T) {
|
||||
opts := []string{"force", "vertical-slices"}
|
||||
if containsOption(opts, "omit-test") {
|
||||
t.Error("containsOption found absent option")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultOutputDir_stable(t *testing.T) {
|
||||
out1 := defaultOutputDir()
|
||||
out2 := defaultOutputDir()
|
||||
if out1 != out2 {
|
||||
t.Error("defaultOutputDir should be deterministic for same cwd")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user