You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn test_pack_unpack_trigram(token in "\\PC{3}", offset_id in 0..u32::MAX, position in proptest::option::of((0..u32::MAX).prop_map(|v| v >> 1))){
124
-
let encoded = TokenInstance::encode(&token, offset_id, position);
145
+
let encoded = TokenInstance::encode(&token, offset_id, position).unwrap();
125
146
let decoded_token = encoded.get_token();
126
147
let decoded_offset_id = encoded.get_offset_id();
127
148
let decoded_position = encoded.get_position();
@@ -133,8 +154,8 @@ mod tests {
133
154
134
155
#[test]
135
156
fn test_omit_position(token in "\\PC{3}", offset_id in 0..u32::MAX, position1 in proptest::option::of(0..u32::MAX), position2 in proptest::option::of(0..u32::MAX)){
136
-
let encoded1 = TokenInstance::encode(&token, offset_id, position1);
137
-
let encoded2 = TokenInstance::encode(&token, offset_id, position2);
157
+
let encoded1 = TokenInstance::encode(&token, offset_id, position1).unwrap();
158
+
let encoded2 = TokenInstance::encode(&token, offset_id, position2).unwrap();
138
159
139
160
assert_eq!(encoded1.omit_position(), encoded2.omit_position(),"Omitting position should make two token instances equal");
140
161
assert_eq!(encoded1.omit_position().get_token(), encoded1.get_token(),"Omitting position should not change the token");
0 commit comments