Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for hasTestFiles (0.09 sec)

  1. cmd/import-boss/main.go

    		// package suffix.  Packages which have test files must be tests.  Don't
    		// ask me, this is what packages.Load produces.
    		if strings.HasSuffix(pkg.PkgPath, "_test") || hasTestFiles(pkg.GoFiles) {
    			// NOTE: This syntax can be undone with unmassage().
    			pkg.PkgPath = strings.TrimSuffix(pkg.PkgPath, "_test") + " ((tests:" + pkg.Name + "))"
    			klog.V(3).Infof("renamed to: %q", pkg.PkgPath)
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 12:36:49 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  2. cmd/import-boss/main_test.go

    		input:  []string{"foo.go", "foo_test.go"},
    		expect: true,
    	}, {
    		input:  []string{"foo.go", "foo_test.go", "bar.go", "bar_test.go"},
    		expect: true,
    	}}
    
    	for _, tc := range cases {
    		ret := hasTestFiles(tc.input)
    		if ret != tc.expect {
    			t.Errorf("expected %v, got %v: %q", tc.expect, ret, tc.input)
    		}
    	}
    }
    
    func TestPackageDir(t *testing.T) {
    	cases := []struct {
    		input  *packages.Package
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 12:36:49 UTC 2024
    - 8.8K bytes
    - Viewed (0)
Back to top