INNER CODE UNIT · Go

TestValidateDirectNavigateFormat

kopecmaciej/vi-mongo · cmd/cmd_test.go:8

func TestValidateDirectNavigateFormat(t *testing.T) {
	tests := []struct {
		name    string
		input   string
		wantErr bool
		errMsg  string
	}{
		{
			name:    "valid format with hyphens",
			input:   "my-db/my-collection",
			wantErr: false,
		},
		{
			name:    "invalid - missing collection",
			input:   "mydb/",
			wantErr: true,
			errMsg:  "both db-name and collection-name are required",
		},

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…