fix: replace panic with error, fix device targeting, add tests - #2
Merged
Merged
Conversation
…ot/Root targeting - execute() no longer panics when adb is not found; returns ErrNotInstalled - Use sync.Once for lazy adb path lookup instead of init() - Fix Pull() checking src (device path) instead of dest (local path) - Add ErrDestExists error for Pull destination conflicts - Add -s serial flag to Push, Pull, Reboot, Root for multi-device support - Root() now parses stdout to determine actual success - Fix Shell() redundant variable redeclaration - Fix 'inconsostency' typo in KillServer doc - Add doc comments to all error variables - Update Go 1.26.0 -> 1.26.1 - Add tests: ConnString, ShortenSleep, GetLength, JSON roundtrip, SequenceImporter.ToInput, insertSleeps, parseDevices edge cases, parseScreenResolution edge cases, filterErr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Bug Fixes
execute()no longer panics when adb is not found — returnsErrNotInstalledinsteadPull()was checking the wrong path — checkedsrc(device-side) instead ofdest(local) for existencePush,Pull,Reboot,Rootnow pass-s serialfor correct multi-device targetingRoot()parses stdout to determine actual success instead of always returning trueShell()removed redundant variable redeclaration (:=→ direct return)Improvements
sync.Oncefor lazy adb path lookup instead ofinit()ErrDestExistserror for Pull destination conflictsTests
ConnString— default port, custom port, IPv6ShortenSleep— verifies scalar divisionGetLength— verifies 110% duration calculationTapSequenceJSON roundtripSequenceImporter.ToInput— all types + unknown fallbackinsertSleeps— verifies sleep insertion between eventsparseDevices— empty string, offline device, extra whitespaceparseScreenResolution— empty string, Samsung S21, override sizefilterErr— basic coverage