libservo: Fix dead code warning and fix two typos in unit tests#42375
libservo: Fix dead code warning and fix two typos in unit tests#42375mrobinson merged 5 commits intoservo:mainfrom
Conversation
|
I have opened a PR for this,please check it, I would really appreciate some feedback! |
|
Thank you, this looks good! You just need to sign-off your commits before we can merge this, see https://book.servo.org/contributing/git-setup.html#starting-a-new-change. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #42375 +/- ##
==========================================
+ Coverage 47.58% 47.61% +0.02%
==========================================
Files 296 296
Lines 70633 70633
Branches 70633 70633
==========================================
+ Hits 33614 33632 +18
+ Misses 35585 35565 -20
- Partials 1434 1436 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
thank you! I have now tried signing off my commits,I hope its working that way too! |
|
Hmm your commits are not signed. You should see a line like |
|
I have edited the message to use Your commit is still unsigned. |
| } | ||
|
|
||
| impl ServoTest { | ||
| pub(crate) fn new() -> Self { |
There was a problem hiding this comment.
This function is used by other tests in webview.rs
ae60269 to
bfb3878
Compare
components/servo/tests/common/mod.rs
Outdated
| #[expect(dead_code)] // Used by some tests and not others | ||
| pub(crate) fn new() -> Self { | ||
| Self::new_with_builder(|builder| builder) | ||
| Self::new_with_builder(|b| b) |
There was a problem hiding this comment.
okay! thank you for the suggestion.
Really appreciate it!
df9af48 to
4970555
Compare
|
Hi! 👋 |
|
🔨 Triggering try run (#21747201717) for Linux (Coverage) |
mrobinson
left a comment
There was a problem hiding this comment.
@Keerti707 I think you accidentally removed your fixes for the dead code and left the unrelated changes. Please take another look.
components/servo/tests/common/mod.rs
Outdated
| impl ServoTest { | ||
| pub(crate) fn new() -> Self { | ||
| Self::new_with_builder(|builder| builder) | ||
| Self::new_with_builder(|b| b) |
There was a problem hiding this comment.
Looks like this one still needs to be reverted.
There was a problem hiding this comment.
Thank you for pointing that out..you are right I reverted the unrelated builder rename,I have now fixed that.
There was a problem hiding this comment.
Now the fixes for the dead code are made too!
I am sorry for the confusion I caused by mistake
Please take a look at the PR now!
I hope it works correctly as per the need.
|
✨ Try run (#21747201717) succeeded. |
Signed-off-by: Keerti Gupta this side!! <[email protected]>
Add dead code expectation for ServoTest::new function. Signed-off-by: Keerti Gupta this side!! <[email protected]>
This PR addresses a dead code warning removed during test builds by ensuring the servo test helper constructor is exercised. None of the functional behaviors are changed and this only improves test clarity and keeps the compiler output warning-free. Fixes: #42364 --------- Signed-off-by: Keerti Gupta this side!! <[email protected]> Signed-off-by: Keerti Gupta <[email protected]>
utilities and also the event handling Signed-off-by: Keerti Gupta <[email protected]>
…ompile errors in tests Signed-off-by: Keerti Gupta <[email protected]>
Remove unused dead code expectation and clean up formatting. Signed-off-by: Keerti Gupta this side!! <[email protected]>
| } | ||
|
|
||
| impl ServoTest { | ||
| #[expect(dead_code)] // Used by some tests and not others |
There was a problem hiding this comment.
If it's sometimes used, it doesn't make sense to expect it to be dead.
Now I'm getting
warning: this lint expectation is unfulfilled
--> components/servo/tests/common/mod.rs:25:14
|
25 | #[expect(dead_code)] // Used by some tests and not others
| ^^^^^^^^^
|
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
So please use allow(dead_code) instead.
There was a problem hiding this comment.
Thank you for noticing that!
I have made the necessary changes!
I hope its working now.
There was a problem hiding this comment.
This PR already landed, you need to open a new one
This PR addresses a dead code warning removed during test builds by ensuring the servo test helper constructor is exercised. None of the functional behaviors are changed and this only improves test clarity and keeps the compiler output warning-free.
Fixes: #42364