MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestValidateWorkspaceFileMode

Function TestValidateWorkspaceFileMode

internal/tool/filereader_test.go:12–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestValidateWorkspaceFileMode(t *testing.T) {
13 for _, tt := range []struct {
14 name string
15 mode os.FileMode
16 wantErr bool
17 }{
18 {"regular", 0644, false},
19 {"named pipe", os.ModeNamedPipe | 0600, true},
20 {"irregular", os.ModeIrregular | 0644, false},
21 {"irregular named pipe", os.ModeIrregular | os.ModeNamedPipe | 0600, true},
22 } {
23 t.Run(tt.name, func(t *testing.T) {
24 err := validateWorkspaceFileMode("source.go", tt.mode)
25 if (err != nil) != tt.wantErr {
26 t.Fatalf("validateWorkspaceFileMode(%v) = %v, want error %v", tt.mode, err, tt.wantErr)
27 }
28 })
29 }
30}
31
32func TestParseReviewMode(t *testing.T) {
33 tests := []struct {

Callers

nothing calls this directly

Calls 2

RunMethod · 0.65

Tested by

no test coverage detected