Closed lhvy closed 2 years ago
Merging #152 (2dd32c2) into master (c14cb08) will increase coverage by
1.96%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #152 +/- ##
==========================================
+ Coverage 62.62% 64.58% +1.96%
==========================================
Files 17 17
Lines 610 624 +14
==========================================
+ Hits 382 403 +21
+ Misses 228 221 -7
Impacted Files | Coverage Δ | |
---|---|---|
src/downloader.rs | 72.89% <100.00%> (ø) |
|
src/scraper.rs | 22.70% <100.00%> (+10.42%) |
:arrow_up: |
I'm unsure how to do this... The tests don't fail on the warn message, and suckit seems to scrape <meta charset='utf-8'>
and output <meta charset="utf-8">
.
@lhvy Here's a test if you want to add it to the scraper.rs
file:
#[test]
fn test_charset_parsing() {
assert_eq!(Scraper::find_charset("<meta charset=\"UTF-8\">".as_bytes(), None), Some(String::from("utf-8")));
assert_eq!(Scraper::find_charset("<meta charset='UTF-8'>".as_bytes(), None), Some(String::from("utf-8")));
}
This just checks that the function returns the correct charset whether the value is between double quotes or single quotes
Resolves #144 with a small change to the regex to account for single or double quotes