()
| 1204 | |
| 1205 | #[test] |
| 1206 | fn test_file_ops_token_count() { |
| 1207 | let mut ops = FileOps::edit(test_trunk_id(), "test.txt".to_string()); |
| 1208 | |
| 1209 | // Add a line with 3 tokens |
| 1210 | ops.add_line_op(LineOps::insert( |
| 1211 | test_branch_id(0), |
| 1212 | None, |
| 1213 | vec![ |
| 1214 | LeafOp::Insert { |
| 1215 | after: None, |
| 1216 | kind: TokenKind::Word, |
| 1217 | content: b"Hello".to_vec(), |
| 1218 | }, |
| 1219 | LeafOp::Insert { |
| 1220 | after: None, |
| 1221 | kind: TokenKind::Whitespace, |
| 1222 | content: b" ".to_vec(), |
| 1223 | }, |
| 1224 | LeafOp::Insert { |
| 1225 | after: None, |
| 1226 | kind: TokenKind::Word, |
| 1227 | content: b"World".to_vec(), |
| 1228 | }, |
| 1229 | ], |
| 1230 | )); |
| 1231 | |
| 1232 | // Add another line with 2 tokens |
| 1233 | ops.add_line_op(LineOps::insert( |
| 1234 | test_branch_id(1), |
| 1235 | Some(test_branch_id(0)), |
| 1236 | vec![ |
| 1237 | LeafOp::Insert { |
| 1238 | after: None, |
| 1239 | kind: TokenKind::Word, |
| 1240 | content: b"Hello".to_vec(), |
| 1241 | }, |
| 1242 | LeafOp::Insert { |
| 1243 | after: None, |
| 1244 | kind: TokenKind::Newline, |
| 1245 | content: b"\n".to_vec(), |
| 1246 | }, |
| 1247 | ], |
| 1248 | )); |
| 1249 | |
| 1250 | assert_eq!(ops.line_count(), 2); |
| 1251 | assert_eq!(ops.token_count(), 5); |
| 1252 | } |
| 1253 | |
| 1254 | #[test] |
| 1255 | fn test_file_ops_display() { |
nothing calls this directly
no test coverage detected