Remove workspace state subsystem
This commit is contained in:
@@ -80,24 +80,3 @@ func TestWriteJSONAtomic(t *testing.T) {
|
||||
t.Fatalf("json = %q, want indented object", data)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCopyFileAtomic(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
source := filepath.Join(dir, "source.txt")
|
||||
target := filepath.Join(dir, "nested", "target.txt")
|
||||
if err := os.WriteFile(source, []byte("copied"), 0o600); err != nil {
|
||||
t.Fatalf("WriteFile() error = %v", err)
|
||||
}
|
||||
|
||||
if err := CopyFileAtomic(source, target); err != nil {
|
||||
t.Fatalf("CopyFileAtomic() error = %v", err)
|
||||
}
|
||||
|
||||
data, err := os.ReadFile(target)
|
||||
if err != nil {
|
||||
t.Fatalf("ReadFile() error = %v", err)
|
||||
}
|
||||
if string(data) != "copied" {
|
||||
t.Fatalf("data = %q, want copied", data)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user