Skip to content
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

Add more tests, remove old comments #100

Merged
merged 7 commits into from
Jul 5, 2023
Merged

Add more tests, remove old comments #100

merged 7 commits into from
Jul 5, 2023

Conversation

TTWNO
Copy link
Member

@TTWNO TTWNO commented Jul 2, 2023

No description provided.

@codecov
Copy link

codecov bot commented Jul 2, 2023

Codecov Report

Merging #100 (a45616f) into main (87a57cb) will increase coverage by 2.11%.
The diff coverage is 99.09%.

@@            Coverage Diff             @@
##             main     #100      +/-   ##
==========================================
+ Coverage   69.88%   72.00%   +2.11%     
==========================================
  Files          67       67              
  Lines        5217     5354     +137     
==========================================
+ Hits         3646     3855     +209     
+ Misses       1571     1499      -72     
Impacted Files Coverage Δ
atspi-common/src/events/document.rs 100.00% <ø> (ø)
atspi-common/src/events/focus.rs 100.00% <ø> (ø)
atspi-common/src/events/keyboard.rs 100.00% <ø> (ø)
atspi-common/src/events/mouse.rs 100.00% <ø> (ø)
atspi-common/src/events/terminal.rs 100.00% <ø> (ø)
atspi-common/src/events/window.rs 100.00% <ø> (ø)
atspi-common/src/interface.rs 89.32% <98.97%> (+29.75%) ⬆️
atspi-common/src/state.rs 85.52% <99.16%> (+11.36%) ⬆️
atspi-common/src/events/object.rs 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@TTWNO TTWNO requested a review from luukvanderduim July 3, 2023 18:05
Copy link
Collaborator

@luukvanderduim luukvanderduim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question on the constants and the Interface enum's manual imps.
The latter half (manual impls) is out of scope for this PR so we can defer the question but it would be nice if we thought about it for a bit.

}*/
/*impl HasRegistryEventString for PageChangedEvent {
const REGISTRY_EVENT_STRING: &'static str = "Document:PageChanged";
}*/
impl HasRegistryEventString for DocumentEvents {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to see the commented blocks go!

@@ -52,26 +73,26 @@ impl<'de> Deserialize<'de> for Interface {
E: de::Error,
{
match value {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why replace the literals "org.a11y.atspi.Event.Accessible", with constants.

What is the advantage over implementing Display on the Interface enum and use that variant where we need it?

I know it was not in this commit but would you know why a manual implementation of Serialize and Deserialize? Trying to think of a reason but if we had TryFrom<&str> for Interface and the From<Interface> for &str would that allow for deriving?

Can we try? If possible I would choose derived serde impls over manual ones.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to think of a reason but if we had TryFrom<&str> for Interface and the From for &str would that allow for deriving?

It would still require a manual implementation of serde's Serialize and Deserialize traits, it's just that we'd be able to take advantage of existing conversions.

I know it was not in this commit but would you know why a manual implementation of Serialize and Deserialize?

I suspect that it was because there's no easy way to set the value of an enum variant to an arbitrary string with serde?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why replace the literals "org.a11y.atspi.Event.Accessible", with constants.

I have had issues before with a mis-matched name in one place not matching another. Using constants avoids any ambiguity. They either work everywhere, or work nowhere.

@TTWNO TTWNO merged commit 828f8b6 into main Jul 5, 2023
@TTWNO TTWNO deleted the add_more_tests branch July 5, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants