args_test.go 363 B

12345678910111213141516171819
  1. package args
  2. import (
  3. "testing"
  4. "go-common/app/tool/gengo/types"
  5. )
  6. func TestInputIncludes(t *testing.T) {
  7. a := &GeneratorArgs{
  8. InputDirs: []string{"a/b/..."},
  9. }
  10. if !a.InputIncludes(&types.Package{Path: "a/b/c"}) {
  11. t.Errorf("Expected /... syntax to work")
  12. }
  13. if a.InputIncludes(&types.Package{Path: "a/c/b"}) {
  14. t.Errorf("Expected correctness")
  15. }
  16. }