Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pct_enc/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pub const PCHAR: Table = UNRESERVED.or(SUB_DELIMS).or(new(b":@")).or_pct_encoded
pub const QUERY: Table = PCHAR.or(new(b"/?"));

/// `fragment = *( pchar / "/" / "?" )`
pub const FRAGMENT: Table = QUERY;
pub const FRAGMENT: Table = QUERY.or(new(b"#"));

/// `unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"`
pub const UNRESERVED: Table = ALPHA.or(DIGIT).or(new(b"-._~"));
Expand Down
8 changes: 8 additions & 0 deletions tests/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ fn parse_relative() {
assert_eq!(r.fragment(), Some(EStr::new_or_panic("fragment")));
}

#[test]
fn parse_tolerance() {
let r = Uri::parse("term://~/code/typos-lsp//59317:/bin/zsh;#toggleterm#1").unwrap();
assert_eq!(r.scheme().as_str(), "term");
assert_eq!(r.path().as_str(), "/code/typos-lsp//59317:/bin/zsh;");
assert_eq!(r.fragment().unwrap().as_str(), "toggleterm#1");
}

use ParseErrorKind::*;

#[test]
Expand Down