-
Notifications
You must be signed in to change notification settings - Fork 44
Fixing Cluster Info + adding cluster layout snapshots #402
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
base: main
Are you sure you want to change the base?
Conversation
|
||
/// Returns the text length of the cluster in bytes. | ||
#[cfg(test)] | ||
pub(crate) fn text_len(&self) -> u8 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really like to test this in check_cluster_snapshot
, so I've exposed it for tests only.
@@ -100,6 +99,11 @@ impl ClusterInfo { | |||
pub(crate) fn is_whitespace(&self) -> bool { | |||
self.source_char.is_whitespace() | |||
} | |||
|
|||
#[cfg(test)] | |||
pub(crate) fn source_char(&self) -> char { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really like to test this in check_cluster_snapshot
, so I've exposed it for tests only.
Intent
I noticed that, although my manual tests were passing, the
source_char
used for a given cluster wasn't always correct. I think we were lucky (if that's the right word) that characters that contribute to a ligature typically mimic the properties of other characters in that ligature.This PR corrects those mistakes and adds more tests and documentation.
check_cluster_snapshot
I think it's pretty tricky to ensure that returned clusters are correct so I've added a new snapshot type enabled via
check_cluster_snapshot
which tries to visualise cluster information (and ensure correcttext_len
). This should makepush_run
more resilient to regressions and maintenance easier.