-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test and clean up PlayQueue #6345
Test and clean up PlayQueue #6345
Conversation
0660a49
to
fe8b253
Compare
50d802b
to
bf270d4
Compare
ebf5237
to
89423a8
Compare
app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java
Outdated
Show resolved
Hide resolved
app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java
Outdated
Show resolved
Hide resolved
app/src/test/java/org/schabi/newpipe/player/playqueue/PlayQueueTest.java
Outdated
Show resolved
Hide resolved
Other than that it looks good to go for me |
- Remove multiple casts of obj - Simply use object equals on the streams because PlayQueueItem’s equals already compares urls
Assignments that don't require the constructor can be moved out.
Original did not cover the case of when streams is empty and documentation does not specify any input restrictions. There's an ambiguity with broadcasting an event between the documentation and the actual code (see TODO).
PlayQueueItem overrides equals and hashCode, so using indexOf is perfectly fine.
Final fields should be arranged first
Stops Android Studio from "recognizing" them as tests
- Add early return for invalid sizes to shuffle - Rename variables to be more descriptive - Refactor moving list element, removing unnecessary operations - Unwrap if clause for adding to history because the condition is guaranteed by the guard clause - Inline the value 0 for the ReorderEvent - Update documentation to reflect new changes
After testing the app, I realized that shuffling a queue with size 2 does nothing
188f651
to
40f6697
Compare
I noticed that the |
Does not affect Gradle tests and only benefits IDE workflow
But aren't the spies used in every test? What i know of is, that the first tests always takes the longest, because it gets all the overhead of initializing stuff |
@TobiGr Should this be squashed before merging? On one hand, it's 20 commits, on the other hand, some of them do have usefull messages that may be worth keeping |
No complaints means no problems 🤷 |
What is it?
Description of the changes in your PR
setIndex(int): void
APK testing
On the website, the APK can be found by going to the "Checks" tab below the title and then on "artifacts" on the right.
Due diligence