summaryrefslogtreecommitdiff
path: root/android_shared_stub_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-01 18:10:19 +0200
committerPaul Buetow <paul@buetow.org>2026-03-01 18:10:19 +0200
commit5247a201c8ba77329c7b1ee40da7b8e43a56b567 (patch)
treed5cd331e7bd5040ef3267e7f888a8c4463cd2832 /android_shared_stub_test.go
parent5fcb97aeb4ec1e291e221794df5d40b27ea60197 (diff)
Release v0.1.0: code quality audit — fix dialog bug, refactor, add testsv0.1.0
- Fix per-keystroke dialog storm when text exceeds maxTextLength - Extract logEntry() for testable persistence with filepath.Join - Extract newInputWidget() and deduplicate shared-text loading - Rename appId to appID per Go naming conventions - Delete unused debugSharedPath function - Add error distinction in readSharedFromCache (log real errors) - Fix ANDORID_NDK_HOME typo to ANDRIOD_NDK_HOME in Magefile - Run gofmt, go mod tidy; promote defaultDirectory to const - Add unit tests for logEntry and readSharedFromCache stub Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'android_shared_stub_test.go')
-rw-r--r--android_shared_stub_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/android_shared_stub_test.go b/android_shared_stub_test.go
new file mode 100644
index 0000000..cc62f5d
--- /dev/null
+++ b/android_shared_stub_test.go
@@ -0,0 +1,15 @@
+//go:build !android
+
+package main
+
+import "testing"
+
+func TestReadSharedFromCacheStub(t *testing.T) {
+ txt, err := readSharedFromCache()
+ if err != nil {
+ t.Fatalf("stub returned error: %v", err)
+ }
+ if txt != "" {
+ t.Errorf("stub returned non-empty text: %q", txt)
+ }
+}