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
let content = "This function will revert if:\n- Any of the Coolers are not owned by the caller.\n- Any of the Coolers have not been created by the CoolerFactory.\n- A duplicate Cooler is provided.";
326
+
327
+
writer.write_dev_content(content).expect("Failed to write dev content with list");
328
+
let result = writer.finish();
329
+
330
+
// Check that the first line is italicized
331
+
assert!(result.contains("*This function will revert if:*"));
332
+
// Check that list items are properly formatted
333
+
assert!(result.contains("- *Any of the Coolers are not owned by the caller.*"));
334
+
assert!(
335
+
result.contains("- *Any of the Coolers have not been created by the CoolerFactory.*")
336
+
);
337
+
assert!(result.contains("- *A duplicate Cooler is provided.*"));
338
+
}
339
+
340
+
#[test]
341
+
fntest_write_dev_content_without_list(){
342
+
letmut writer = BufWriter::default();
343
+
let content = "This is a simple dev comment without any lists.";
344
+
345
+
writer.write_dev_content(content).expect("Failed to write dev content without list");
346
+
let result = writer.finish();
347
+
348
+
// Check that the entire content is italicized
349
+
assert!(result.contains("*This is a simple dev comment without any lists.*"));
350
+
}
351
+
352
+
#[test]
353
+
fntest_write_dev_content_empty_lines(){
354
+
letmut writer = BufWriter::default();
355
+
let content = "This function will revert if:\n\n- First item.\n\n- Second item.";
356
+
357
+
writer.write_dev_content(content).expect("Failed to write dev content with empty lines");
358
+
let result = writer.finish();
359
+
360
+
// Check that empty lines are preserved
361
+
assert!(result.contains("*This function will revert if:*"));
0 commit comments