Hello world 👋
Release / Build and publish (push) Successful in 22s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kebandClaude Opus 5.5 committed 2026-10-10 23:58:25 +02:00
commit 6fab41703e
111 files changed
+22988

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
package clipboard
import "testing"
func fakeNative() (*Clipboard, *string) {
var board string
return &Clipboard{
native: true,
read: func() (string, error) { return board, nil },
write: func(s string) error { board = s; return nil },
}, &board
}
func TestClearOnlyIfUnchanged(t *testing.T) {
c, board := fakeNative()
c.Write("secret")()
if *board != "secret" {
t.Fatalf("board = %q", *board)
}
fp := Fingerprint("secret")
*board = "something the user copied later"
c.Clear(fp)()
if *board != "something the user copied later" {
t.Error("cleared text the user copied afterwards")
}
*board = "secret"
c.Clear(fp)()
if *board != "" {
t.Errorf("not cleared: %q", *board)
}
}