Move distributed bug fixing app from core/cli internal/bugseti/ and cmd/bugseti/ into its own module. Library code at package root, app entry point in cmd/, design docs in docs/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
616 B
Go
37 lines
616 B
Go
package bugseti
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
)
|
|
|
|
func TestConfigPermissions(t *testing.T) {
|
|
// Get a temporary file path
|
|
f, err := os.CreateTemp("", "bugseti-config-*.json")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
name := f.Name()
|
|
f.Close()
|
|
os.Remove(name) // Ensure it doesn't exist
|
|
defer os.Remove(name)
|
|
|
|
c := &ConfigService{
|
|
path: name,
|
|
config: &Config{},
|
|
}
|
|
|
|
if err := c.Save(); err != nil {
|
|
t.Fatalf("Save failed: %v", err)
|
|
}
|
|
|
|
info, err := os.Stat(name)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
mode := info.Mode().Perm()
|
|
if mode != 0600 {
|
|
t.Errorf("expected file permissions 0600, got %04o", mode)
|
|
}
|
|
}
|