Skip to content

Commit

Permalink
fix rust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed Aug 7, 2024
1 parent e99daff commit dd6652b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tokenizers/src/pre_tokenizers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,13 @@ mod tests {
_ => panic!("Expected an error here"),
}

let json = r#"{"type":"Metaspace", "replacement":"▁" }"#;
let json = r#"{"type":"Metaspace", "str_rep":"▁" }"#;
let reconstructed = serde_json::from_str::<PreTokenizerWrapper>(json);
println!("{:?}",reconstructed);
match reconstructed {
Err(err) => assert_eq!(
err.to_string(),
"data did not match any variant of untagged enum PreTokenizerUntagged"
"missing field `replacement`"
),
_ => panic!("Expected an error here"),
}
Expand All @@ -308,7 +309,7 @@ mod tests {
match reconstructed {
Err(err) => assert_eq!(
err.to_string(),
"data did not match any variant of untagged enum PreTokenizerWrapper"
"missing field `replacement`"
),
_ => panic!("Expected an error here"),
}
Expand Down

0 comments on commit dd6652b

Please sign in to comment.