Skip to content

Commit

Permalink
test: add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
KisaragiEffective committed Oct 19, 2023
1 parent bb510d2 commit 97a3933
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions package/origlang-compiler/src/lexer/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,19 @@ fn crlf_negative() {
char: '\r',
});
}

#[test]
fn off_by_one_range_regression() {
const S: &str = "9";
let lexer = Lexer::create(S);
assert_eq!(lexer.next(), Pointed {
data: Token::Digits {
sequence: "9".to_string(),
suffix: None,
},
position: SourcePosition {
line: NonZeroUsize::new(1).unwrap(),
column: NonZeroUsize::new(1).unwrap(),
}
})
}

0 comments on commit 97a3933

Please sign in to comment.