add back in the tests for query_web in the nu_plugin_query (#4614)

* fix first test

* fix 2nd query_web test
This commit is contained in:
Michael Angerman 2022-02-23 08:43:36 -08:00 committed by GitHub
parent 676457acd3
commit 63487941fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,28 +276,31 @@ pub fn css(selector: &str) -> ScraperSelector {
ScraperSelector::parse(selector).expect("this should never trigger") ScraperSelector::parse(selector).expect("this should never trigger")
} }
// #[cfg(test)] #[cfg(test)]
// mod tests { mod tests {
// use super::*; use super::*;
// const SIMPLE_LIST: &str = r#" const SIMPLE_LIST: &str = r#"
// <ul> <ul>
// <li>Coffee</li> <li>Coffee</li>
// <li>Tea</li> <li>Tea</li>
// <li>Milk</li> <li>Milk</li>
// </ul> </ul>
// "#; "#;
// #[test] #[test]
// fn test_first_child_is_not_empty() { fn test_first_child_is_not_empty() {
// assert!(!execute_selector_query(SIMPLE_LIST, "li:first-child", false).is_empty()) assert!(
// } !execute_selector_query(SIMPLE_LIST, "li:first-child", false, Span::test_data())
.is_empty()
)
}
// #[test] #[test]
// fn test_first_child() { fn test_first_child() {
// assert_eq!( let item = execute_selector_query(SIMPLE_LIST, "li:first-child", false, Span::test_data());
// vec!["Coffee".to_string()], let config = nu_protocol::Config::default();
// execute_selector_query(SIMPLE_LIST, "li:first-child", false) let out = item.into_string("\n", &config);
// ) assert_eq!("[Coffee]".to_string(), out)
// } }
// } }