FIX: Use unicode code points in getFormulaHTML function

This commit is contained in:
Nicolás Hatcher
2024-12-09 19:52:12 +01:00
parent a05ff18e40
commit 65f1738473
2 changed files with 32 additions and 3 deletions

View File

@@ -24,6 +24,25 @@ fn test_get_tokens() {
assert_eq!(l.end, 10);
}
#[test]
fn get_tokens_unicode() {
let formula = "'🇵🇭 Philippines'!A1";
let t = get_tokens(formula);
assert_eq!(t.len(), 1);
let expected = TokenType::Reference {
sheet: Some("🇵🇭 Philippines".to_string()),
row: 1,
column: 1,
absolute_column: false,
absolute_row: false,
};
let l = t.first().expect("expected token");
assert_eq!(l.token, expected);
assert_eq!(l.start, 0);
assert_eq!(l.end, 19);
}
#[test]
fn test_simple_tokens() {
assert_eq!(