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
assert_eq!(doc.render(),"![A cute picture of a sandcat][A cute picture of a sandcat]\n\n[A cute picture of a sandcat]: https://example.com/picture.png\n");
268
367
}
368
+
369
+
#[test]
370
+
fntest_document_with_link(){
371
+
letmut doc = Markdown::new();
372
+
doc.link(
373
+
LinkBuilder::new()
374
+
.url("https://example.com/picture.png")
375
+
.text("A cute picture of a sandcat")
376
+
.build(),
377
+
);
378
+
379
+
assert_eq!(
380
+
doc.render(),
381
+
"[A cute picture of a sandcat](https://example.com/picture.png)\n"
382
+
);
383
+
}
384
+
385
+
#[test]
386
+
fntest_document_with_link_footer(){
387
+
letmut doc = Markdown::new();
388
+
doc.link(
389
+
LinkBuilder::new()
390
+
.url("https://example.com/picture.png")
391
+
.text("A cute picture of a sandcat")
392
+
.footer()
393
+
.build(),
394
+
);
395
+
396
+
assert_eq!(doc.render(),"[A cute picture of a sandcat][A cute picture of a sandcat]\n\n[A cute picture of a sandcat]: https://example.com/picture.png\n");
397
+
}
398
+
399
+
#[test]
400
+
fntest_document_with_list(){
401
+
letmut doc = Markdown::new();
402
+
403
+
doc.list(
404
+
ListBuilder::new()
405
+
.append("First do this")
406
+
.append("Then do this")
407
+
.ordered(),
408
+
);
409
+
410
+
assert_eq!(doc.render(),"1. First do this\n2. Then do this\n")
0 commit comments