MCPcopy Create free account
hub / github.com/untitaker/hyperlink / test_document_join_bare_html

Function test_document_join_bare_html

src/html/mod.rs:683–726  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

681
682#[test]
683fn test_document_join_bare_html() {
684 let arena = bumpalo::Bump::new();
685 let mut scratch = String::new();
686
687 let doc = Document::new(
688 Path::new("public/"),
689 Path::new("public/platforms/python/troubleshooting.html"),
690 );
691
692 assert_eq!(
693 doc.join(&arena, &mut scratch, false, "../ruby#foo"),
694 Href("platforms/ruby")
695 );
696 assert_eq!(
697 doc.join(&arena, &mut scratch, true, "../ruby#foo"),
698 Href("platforms/ruby#foo")
699 );
700 assert_eq!(
701 doc.join(&arena, &mut scratch, true, "../ruby?bar=1#foo"),
702 Href("platforms/ruby#foo")
703 );
704
705 assert_eq!(
706 doc.join(&arena, &mut scratch, false, "/platforms/ruby"),
707 Href("platforms/ruby")
708 );
709 assert_eq!(
710 doc.join(&arena, &mut scratch, true, "/platforms/ruby?bar=1#foo"),
711 Href("platforms/ruby#foo")
712 );
713 assert_eq!(
714 doc.join(&arena, &mut scratch, false, "/locations/troms%C3%B8"),
715 Href("locations/tromsø")
716 );
717 assert_eq!(
718 doc.join(
719 &arena,
720 &mut scratch,
721 true,
722 "/locations/oslo#gr%C3%BCnerl%C3%B8kka"
723 ),
724 Href("locations/oslo#grünerløkka")
725 );
726}
727
728#[test]
729fn test_paragraph_nesting() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…