Skip to content

Commit

Permalink
Add advice about testing
Browse files Browse the repository at this point in the history
  • Loading branch information
PoignardAzur committed Dec 12, 2024
1 parent 59f3940 commit 8d6f2f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions parley/src/cursor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ use crate::{Affinity, Cursor, FontContext, Layout, LayoutContext};
/// terminal.
///
/// Others will be fixed in the future.
///
/// # Writing tests with Parley
///
/// This API enables users to write tests for cursor values where the intent of
/// the test is obvious from the code of the test alone.
///
/// In general, Parley tries to encourage users to write this style of test.
/// Users should avoid tests where you compare the cursor to a numeric value
/// (mapping a numeric value to a cursor position is not obvious) and
/// screenshot tests (readers shouldn't need to open a screenshot file).
pub struct CursorTest {
text: String,
layout: Layout<()>,
Expand Down

0 comments on commit 8d6f2f5

Please sign in to comment.