diff --git a/crates/nu_plugin_query/src/query_webpage_info.rs b/crates/nu_plugin_query/src/query_webpage_info.rs index 8fed37dcd3..e61387c8d1 100644 --- a/crates/nu_plugin_query/src/query_webpage_info.rs +++ b/crates/nu_plugin_query/src/query_webpage_info.rs @@ -61,22 +61,6 @@ fn execute_webpage(html: &str, span: Span) -> Result { Ok(value) } -#[cfg(test)] -mod tests { - use super::*; - - const HTML: &str = r#" - My Title - "#; - - #[test] - fn test_basics() { - let info = execute_webpage(HTML, Span::test_data()).unwrap(); - let record = info.as_record().unwrap(); - assert_eq!(record.get("title").unwrap().as_str().unwrap(), "My Title"); - } -} - // revive nu-serde sketch use serde::Serialize; @@ -476,3 +460,19 @@ impl<'a> serde::ser::SerializeTupleVariant for SeqSerializer<'a> { Ok(Value::list(self.seq, self.serializer.span)) } } + +#[cfg(test)] +mod tests { + use super::*; + + const HTML: &str = r#" + My Title + "#; + + #[test] + fn test_basics() { + let info = execute_webpage(HTML, Span::test_data()).unwrap(); + let record = info.as_record().unwrap(); + assert_eq!(record.get("title").unwrap().as_str().unwrap(), "My Title"); + } +}