diff --git a/packages/hurl/src/cli/summary.rs b/packages/hurl/src/cli/summary.rs index b547fa594..48d5ebce3 100644 --- a/packages/hurl/src/cli/summary.rs +++ b/packages/hurl/src/cli/summary.rs @@ -60,7 +60,8 @@ fn requests_count(runs: &[HurlRun]) -> usize { #[cfg(test)] pub mod tests { use hurl::runner::{EntryResult, HurlResult, Input}; - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use super::*; diff --git a/packages/hurl/src/jsonpath/parser/error.rs b/packages/hurl/src/jsonpath/parser/error.rs index bf5ed2b35..63bbe8126 100644 --- a/packages/hurl/src/jsonpath/parser/error.rs +++ b/packages/hurl/src/jsonpath/parser/error.rs @@ -15,7 +15,8 @@ * limitations under the License. * */ -use hurl_core::ast::Pos; + +use hurl_core::reader::Pos; #[derive(Clone, Debug, PartialEq, Eq)] pub struct ParseError { diff --git a/packages/hurl/src/jsonpath/parser/parse.rs b/packages/hurl/src/jsonpath/parser/parse.rs index d3f874434..c05dda039 100644 --- a/packages/hurl/src/jsonpath/parser/parse.rs +++ b/packages/hurl/src/jsonpath/parser/parse.rs @@ -277,7 +277,7 @@ fn equal_string_predicate_func(reader: &mut Reader) -> ParseResult Response { diff --git a/packages/hurl/src/report/html/nav.rs b/packages/hurl/src/report/html/nav.rs index 0877e0cbe..1e6939870 100644 --- a/packages/hurl/src/report/html/nav.rs +++ b/packages/hurl/src/report/html/nav.rs @@ -109,7 +109,8 @@ fn html_escape(text: &str) -> String { mod tests { use crate::report::html::nav::error_to_html; use crate::runner::{RunnerError, RunnerErrorKind}; - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; #[test] fn test_error_html() { diff --git a/packages/hurl/src/report/html/source.rs b/packages/hurl/src/report/html/source.rs index a932d924f..8c7221a68 100644 --- a/packages/hurl/src/report/html/source.rs +++ b/packages/hurl/src/report/html/source.rs @@ -83,7 +83,8 @@ fn underline_errors(content: &str, errors: &[RunnerError]) -> String { #[cfg(test)] mod tests { - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use super::*; use crate::runner::RunnerErrorKind::QueryHeaderNotFound; diff --git a/packages/hurl/src/report/junit/mod.rs b/packages/hurl/src/report/junit/mod.rs index de91282a7..1b162fde4 100644 --- a/packages/hurl/src/report/junit/mod.rs +++ b/packages/hurl/src/report/junit/mod.rs @@ -147,7 +147,8 @@ fn create_testsuite(testcases: &[Testcase]) -> Element { #[cfg(test)] mod tests { use crate::http::HttpError; - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use crate::report::junit::xml::XmlDocument; use crate::report::junit::{create_testsuite, Testcase}; diff --git a/packages/hurl/src/report/junit/testcase.rs b/packages/hurl/src/report/junit/testcase.rs index b8b16097e..ff11246f7 100644 --- a/packages/hurl/src/report/junit/testcase.rs +++ b/packages/hurl/src/report/junit/testcase.rs @@ -91,7 +91,8 @@ impl Testcase { #[cfg(test)] mod test { use crate::http::HttpError; - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use crate::report::junit::testcase::Testcase; use crate::report::junit::xml::XmlDocument; diff --git a/packages/hurl/src/runner/assert.rs b/packages/hurl/src/runner/assert.rs index 41f02dfdd..72329cdc3 100644 --- a/packages/hurl/src/runner/assert.rs +++ b/packages/hurl/src/runner/assert.rs @@ -178,6 +178,7 @@ pub fn eval_explicit_assert( #[cfg(test)] pub mod tests { use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use std::path::Path; use super::super::query; diff --git a/packages/hurl/src/runner/body.rs b/packages/hurl/src/runner/body.rs index 074895ed1..d9eb1a9ac 100644 --- a/packages/hurl/src/runner/body.rs +++ b/packages/hurl/src/runner/body.rs @@ -93,6 +93,7 @@ mod tests { use std::path::Path; use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use super::*; diff --git a/packages/hurl/src/runner/capture.rs b/packages/hurl/src/runner/capture.rs index 8af9de8c1..aeb9715da 100644 --- a/packages/hurl/src/runner/capture.rs +++ b/packages/hurl/src/runner/capture.rs @@ -71,7 +71,8 @@ pub fn eval_capture( #[cfg(test)] pub mod tests { - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use self::super::super::query; use super::*; diff --git a/packages/hurl/src/runner/error.rs b/packages/hurl/src/runner/error.rs index 86baa3fd3..9a9280400 100644 --- a/packages/hurl/src/runner/error.rs +++ b/packages/hurl/src/runner/error.rs @@ -317,8 +317,9 @@ fn color_red_multiline_string(s: &str) -> StyledString { mod tests { use crate::http::HttpError; use crate::runner::{RunnerError, RunnerErrorKind}; - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; use hurl_core::error::{error_string, split_lines, DisplaySourceError, OutputFormat}; + use hurl_core::reader::Pos; use hurl_core::text::Format; #[test] diff --git a/packages/hurl/src/runner/filter/count.rs b/packages/hurl/src/runner/filter/count.rs index 96594e9cb..f404b8560 100644 --- a/packages/hurl/src/runner/filter/count.rs +++ b/packages/hurl/src/runner/filter/count.rs @@ -39,7 +39,8 @@ pub fn eval_count( #[cfg(test)] pub mod tests { use crate::runner::filter::eval::eval_filter; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; use super::*; diff --git a/packages/hurl/src/runner/filter/days_after_now.rs b/packages/hurl/src/runner/filter/days_after_now.rs index cd569f56d..3b5484614 100644 --- a/packages/hurl/src/runner/filter/days_after_now.rs +++ b/packages/hurl/src/runner/filter/days_after_now.rs @@ -44,7 +44,8 @@ pub mod tests { use crate::runner::filter::eval::eval_filter; use chrono::offset::Utc; use chrono::Duration; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; use super::*; diff --git a/packages/hurl/src/runner/filter/decode.rs b/packages/hurl/src/runner/filter/decode.rs index e0a6328af..6ffeee2c8 100644 --- a/packages/hurl/src/runner/filter/decode.rs +++ b/packages/hurl/src/runner/filter/decode.rs @@ -57,7 +57,8 @@ pub fn eval_decode( #[cfg(test)] pub mod tests { use crate::runner::filter::eval::eval_filter; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use super::*; diff --git a/packages/hurl/src/runner/filter/eval.rs b/packages/hurl/src/runner/filter/eval.rs index 50aac5d69..4b50263be 100644 --- a/packages/hurl/src/runner/filter/eval.rs +++ b/packages/hurl/src/runner/filter/eval.rs @@ -122,7 +122,8 @@ pub fn eval_filter( pub mod tests { use crate::runner::filter::eval::eval_filters; use crate::runner::{Number, Value}; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/format.rs b/packages/hurl/src/runner/filter/format.rs index 3eafbf353..afa9652f0 100644 --- a/packages/hurl/src/runner/filter/format.rs +++ b/packages/hurl/src/runner/filter/format.rs @@ -46,7 +46,8 @@ pub fn eval_format( #[cfg(test)] pub mod tests { use crate::runner::filter::eval::eval_filter; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use super::*; diff --git a/packages/hurl/src/runner/filter/html_escape.rs b/packages/hurl/src/runner/filter/html_escape.rs index 97a5edf94..b8f507901 100644 --- a/packages/hurl/src/runner/filter/html_escape.rs +++ b/packages/hurl/src/runner/filter/html_escape.rs @@ -42,7 +42,8 @@ pub fn eval_html_escape( pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::Value; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/html_unescape.rs b/packages/hurl/src/runner/filter/html_unescape.rs index a08bac7eb..d735bfdf1 100644 --- a/packages/hurl/src/runner/filter/html_unescape.rs +++ b/packages/hurl/src/runner/filter/html_unescape.rs @@ -42,7 +42,8 @@ pub fn eval_html_unescape( pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::Value; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/jsonpath.rs b/packages/hurl/src/runner/filter/jsonpath.rs index 0322a0f19..e9faa1585 100644 --- a/packages/hurl/src/runner/filter/jsonpath.rs +++ b/packages/hurl/src/runner/filter/jsonpath.rs @@ -77,9 +77,8 @@ pub fn eval_jsonpath_string( #[cfg(test)] pub mod tests { - use hurl_core::ast::{ - Filter, FilterValue, Pos, SourceInfo, Template, TemplateElement, Whitespace, - }; + use hurl_core::ast::{Filter, FilterValue, SourceInfo, Template, TemplateElement, Whitespace}; + use hurl_core::reader::Pos; use std::collections::HashMap; use crate::runner::filter::eval::eval_filter; diff --git a/packages/hurl/src/runner/filter/nth.rs b/packages/hurl/src/runner/filter/nth.rs index 8e6233a58..613817644 100644 --- a/packages/hurl/src/runner/filter/nth.rs +++ b/packages/hurl/src/runner/filter/nth.rs @@ -48,7 +48,8 @@ pub fn eval_nth( pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::{Number, RunnerError, RunnerErrorKind, Value}; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo, Whitespace}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo, Whitespace}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/regex.rs b/packages/hurl/src/runner/filter/regex.rs index 3c6b5c50d..31005b64c 100644 --- a/packages/hurl/src/runner/filter/regex.rs +++ b/packages/hurl/src/runner/filter/regex.rs @@ -53,8 +53,10 @@ pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::{RunnerErrorKind, Value}; use hurl_core::ast::{ - Filter, FilterValue, Pos, RegexValue, SourceInfo, Template, TemplateElement, Whitespace, + Filter, FilterValue, RegexValue, SourceInfo, Template, TemplateElement, Whitespace, }; + use hurl_core::reader::Pos; + #[test] fn eval_filter_regex() { // regex "Hello (.*)!" diff --git a/packages/hurl/src/runner/filter/replace.rs b/packages/hurl/src/runner/filter/replace.rs index 7219f67f9..5126a541e 100644 --- a/packages/hurl/src/runner/filter/replace.rs +++ b/packages/hurl/src/runner/filter/replace.rs @@ -51,8 +51,9 @@ pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::Value; use hurl_core::ast::{ - Filter, FilterValue, Pos, RegexValue, SourceInfo, Template, TemplateElement, Whitespace, + Filter, FilterValue, RegexValue, SourceInfo, Template, TemplateElement, Whitespace, }; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/split.rs b/packages/hurl/src/runner/filter/split.rs index 3cbd1e5d4..870e219c1 100644 --- a/packages/hurl/src/runner/filter/split.rs +++ b/packages/hurl/src/runner/filter/split.rs @@ -50,9 +50,8 @@ pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::Value; - use hurl_core::ast::{ - Filter, FilterValue, Pos, SourceInfo, Template, TemplateElement, Whitespace, - }; + use hurl_core::ast::{Filter, FilterValue, SourceInfo, Template, TemplateElement, Whitespace}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/to_date.rs b/packages/hurl/src/runner/filter/to_date.rs index 089e418fd..25f38befb 100644 --- a/packages/hurl/src/runner/filter/to_date.rs +++ b/packages/hurl/src/runner/filter/to_date.rs @@ -56,9 +56,8 @@ pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::Value; use chrono::{DateTime, NaiveDate, Utc}; - use hurl_core::ast::{ - Filter, FilterValue, Pos, SourceInfo, Template, TemplateElement, Whitespace, - }; + use hurl_core::ast::{Filter, FilterValue, SourceInfo, Template, TemplateElement, Whitespace}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/to_float.rs b/packages/hurl/src/runner/filter/to_float.rs index 5366730bd..ec0cc31a8 100644 --- a/packages/hurl/src/runner/filter/to_float.rs +++ b/packages/hurl/src/runner/filter/to_float.rs @@ -46,7 +46,8 @@ pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::{Number, RunnerErrorKind, Value}; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/to_int.rs b/packages/hurl/src/runner/filter/to_int.rs index beaf507cb..adfbda0a3 100644 --- a/packages/hurl/src/runner/filter/to_int.rs +++ b/packages/hurl/src/runner/filter/to_int.rs @@ -47,7 +47,8 @@ pub mod tests { use crate::runner::filter::eval::eval_filter; use crate::runner::{Number, RunnerErrorKind, Value}; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/filter/url_encode.rs b/packages/hurl/src/runner/filter/url_encode.rs index 3dcf3058c..1cf1749a6 100644 --- a/packages/hurl/src/runner/filter/url_encode.rs +++ b/packages/hurl/src/runner/filter/url_encode.rs @@ -48,10 +48,10 @@ pub fn eval_url_encode( #[cfg(test)] pub mod tests { - use crate::runner::filter::eval::eval_filter; use crate::runner::Value; - use hurl_core::ast::{Filter, FilterValue, Pos, SourceInfo}; + use hurl_core::ast::{Filter, FilterValue, SourceInfo}; + use hurl_core::reader::Pos; use std::collections::HashMap; #[test] diff --git a/packages/hurl/src/runner/json.rs b/packages/hurl/src/runner/json.rs index 7a309ba31..3c1d2ebc4 100644 --- a/packages/hurl/src/runner/json.rs +++ b/packages/hurl/src/runner/json.rs @@ -178,6 +178,7 @@ fn encode_json_char(c: char) -> String { #[cfg(test)] mod tests { use hurl_core::ast::*; + use hurl_core::reader::Pos; use super::super::error::RunnerErrorKind; use super::*; diff --git a/packages/hurl/src/runner/multiline.rs b/packages/hurl/src/runner/multiline.rs index f5b561918..54a3e6019 100644 --- a/packages/hurl/src/runner/multiline.rs +++ b/packages/hurl/src/runner/multiline.rs @@ -60,9 +60,10 @@ mod tests { use std::collections::HashMap; use hurl_core::ast::{ - GraphQl, GraphQlVariables, JsonObjectElement, JsonValue, MultilineString, Pos, SourceInfo, + GraphQl, GraphQlVariables, JsonObjectElement, JsonValue, MultilineString, SourceInfo, Template, TemplateElement, Whitespace, }; + use hurl_core::reader::Pos; use crate::runner::multiline::eval_multiline; diff --git a/packages/hurl/src/runner/multipart.rs b/packages/hurl/src/runner/multipart.rs index c7ea264bc..da5058ab8 100644 --- a/packages/hurl/src/runner/multipart.rs +++ b/packages/hurl/src/runner/multipart.rs @@ -95,6 +95,7 @@ pub fn file_value_content_type( #[cfg(test)] mod tests { use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use super::*; diff --git a/packages/hurl/src/runner/options.rs b/packages/hurl/src/runner/options.rs index cd4d65d03..5d0c8f233 100644 --- a/packages/hurl/src/runner/options.rs +++ b/packages/hurl/src/runner/options.rs @@ -444,7 +444,8 @@ fn eval_number(number: &AstNumber) -> Value { #[cfg(test)] mod tests { - use hurl_core::ast::{Expr, Pos, SourceInfo, Variable, Whitespace}; + use hurl_core::ast::{Expr, SourceInfo, Variable, Whitespace}; + use hurl_core::reader::Pos; use super::*; use crate::runner::RunnerErrorKind; diff --git a/packages/hurl/src/runner/predicate.rs b/packages/hurl/src/runner/predicate.rs index 3c3a44004..65694d1c3 100644 --- a/packages/hurl/src/runner/predicate.rs +++ b/packages/hurl/src/runner/predicate.rs @@ -19,6 +19,7 @@ use std::cmp::Ordering; use std::collections::HashMap; use hurl_core::ast::*; +use hurl_core::reader::Pos; use crate::runner::error::RunnerError; use crate::runner::predicate_value::{eval_predicate_value, eval_predicate_value_template}; diff --git a/packages/hurl/src/runner/query.rs b/packages/hurl/src/runner/query.rs index 3cd90ae98..5c81604e9 100644 --- a/packages/hurl/src/runner/query.rs +++ b/packages/hurl/src/runner/query.rs @@ -354,7 +354,8 @@ impl Value { pub mod tests { use crate::http::{HeaderVec, HttpError, HttpVersion}; use hex_literal::hex; - use hurl_core::ast::{Pos, SourceInfo}; + use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use super::*; diff --git a/packages/hurl/src/runner/request.rs b/packages/hurl/src/runner/request.rs index 88f76aa04..6b33c6e49 100644 --- a/packages/hurl/src/runner/request.rs +++ b/packages/hurl/src/runner/request.rs @@ -167,6 +167,7 @@ fn eval_method(method: &Method) -> http::Method { #[cfg(test)] mod tests { use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use super::super::error::RunnerErrorKind; use super::*; diff --git a/packages/hurl/src/runner/response.rs b/packages/hurl/src/runner/response.rs index 337adbf56..220b18acf 100644 --- a/packages/hurl/src/runner/response.rs +++ b/packages/hurl/src/runner/response.rs @@ -366,6 +366,7 @@ mod tests { use self::super::super::{assert, capture}; use super::*; use crate::runner::Number; + use hurl_core::reader::Pos; pub fn user_response() -> Response { let whitespace = Whitespace { diff --git a/packages/hurl/src/runner/result.rs b/packages/hurl/src/runner/result.rs index 9f5894a6a..efbd0d94a 100644 --- a/packages/hurl/src/runner/result.rs +++ b/packages/hurl/src/runner/result.rs @@ -15,7 +15,8 @@ * limitations under the License. * */ -use hurl_core::ast::{Pos, SourceInfo}; +use hurl_core::ast::SourceInfo; +use hurl_core::reader::Pos; use crate::http::{Call, Cookie}; use crate::runner::error::RunnerError; diff --git a/packages/hurl/src/runner/template.rs b/packages/hurl/src/runner/template.rs index 17a8cca4d..2ec0e4a50 100644 --- a/packages/hurl/src/runner/template.rs +++ b/packages/hurl/src/runner/template.rs @@ -93,6 +93,7 @@ impl Value { #[cfg(test)] mod tests { use hurl_core::ast::SourceInfo; + use hurl_core::reader::Pos; use super::*; use crate::runner::Number; diff --git a/packages/hurl_core/src/ast/core.rs b/packages/hurl_core/src/ast/core.rs index e89ba3625..9cf8cc808 100644 --- a/packages/hurl_core/src/ast/core.rs +++ b/packages/hurl_core/src/ast/core.rs @@ -16,6 +16,7 @@ * */ use crate::ast::json; +use crate::reader::Pos; use crate::typing::{Repeat, Retry}; /// @@ -665,18 +666,6 @@ impl PartialEq for Regex { } impl Eq for Regex {} -#[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub struct Pos { - pub line: usize, - pub column: usize, -} - -impl Pos { - pub fn new(line: usize, column: usize) -> Pos { - Pos { line, column } - } -} - #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct SourceInfo { pub start: Pos, diff --git a/packages/hurl_core/src/ast/display.rs b/packages/hurl_core/src/ast/display.rs index 8df94bf07..9557a3c3b 100644 --- a/packages/hurl_core/src/ast/display.rs +++ b/packages/hurl_core/src/ast/display.rs @@ -290,6 +290,7 @@ impl PredicateFuncValue { #[cfg(test)] mod tests { use super::*; + use crate::reader::Pos; fn whitespace() -> Whitespace { Whitespace { diff --git a/packages/hurl_core/src/ast/json.rs b/packages/hurl_core/src/ast/json.rs index 08730a613..6cfbc4545 100644 --- a/packages/hurl_core/src/ast/json.rs +++ b/packages/hurl_core/src/ast/json.rs @@ -216,7 +216,8 @@ impl TemplateElement { #[cfg(test)] mod tests { use super::*; - use crate::ast::{Pos, SourceInfo, TemplateElement, Variable, Whitespace}; + use crate::ast::{SourceInfo, TemplateElement, Variable, Whitespace}; + use crate::reader::Pos; #[test] fn test_to_string() { diff --git a/packages/hurl_core/src/error/mod.rs b/packages/hurl_core/src/error/mod.rs index fd1dfdb0e..4903a80fb 100644 --- a/packages/hurl_core/src/error/mod.rs +++ b/packages/hurl_core/src/error/mod.rs @@ -278,7 +278,7 @@ pub fn add_source_line(text: &mut StyledString, content: &[&str], line: usize) { #[cfg(test)] mod tests { use super::*; - use crate::ast::Pos; + use crate::reader::Pos; use crate::text::Style; #[test] diff --git a/packages/hurl_core/src/format/html.rs b/packages/hurl_core/src/format/html.rs index 9caaf87c5..bb75a286e 100644 --- a/packages/hurl_core/src/format/html.rs +++ b/packages/hurl_core/src/format/html.rs @@ -916,6 +916,7 @@ fn pop_str(string: &mut String, suffix: &str) { #[cfg(test)] mod tests { use super::*; + use crate::reader::Pos; #[test] fn test_multiline_string() { diff --git a/packages/hurl_core/src/parser/bytes.rs b/packages/hurl_core/src/parser/bytes.rs index 165bc0573..81b239f6f 100644 --- a/packages/hurl_core/src/parser/bytes.rs +++ b/packages/hurl_core/src/parser/bytes.rs @@ -77,6 +77,7 @@ fn string_bytes(reader: &mut Reader) -> ParseResult { mod tests { use super::super::error::*; use super::*; + use crate::reader::Pos; #[test] fn test_bytes_json() { diff --git a/packages/hurl_core/src/parser/cookiepath.rs b/packages/hurl_core/src/parser/cookiepath.rs index 1c0b35b21..fb1bf42ab 100644 --- a/packages/hurl_core/src/parser/cookiepath.rs +++ b/packages/hurl_core/src/parser/cookiepath.rs @@ -69,7 +69,8 @@ fn cookiepath_attribute_name(reader: &mut Reader) -> ParseResult ParseResult { #[cfg(test)] mod tests { use super::*; - use crate::ast::Pos; + use crate::reader::Pos; #[test] fn test_expr() { diff --git a/packages/hurl_core/src/parser/filename.rs b/packages/hurl_core/src/parser/filename.rs index 3e5a4848e..0e6df74f6 100644 --- a/packages/hurl_core/src/parser/filename.rs +++ b/packages/hurl_core/src/parser/filename.rs @@ -150,7 +150,7 @@ fn filename_escaped_char(reader: &mut Reader) -> ParseResult { #[cfg(test)] mod tests { use super::*; - use crate::ast::Pos; + use crate::reader::Pos; #[test] fn test_filename() { diff --git a/packages/hurl_core/src/parser/filename_password.rs b/packages/hurl_core/src/parser/filename_password.rs index a3bf08049..e8744bf76 100644 --- a/packages/hurl_core/src/parser/filename_password.rs +++ b/packages/hurl_core/src/parser/filename_password.rs @@ -157,7 +157,7 @@ fn filename_password_escaped_char(reader: &mut Reader) -> ParseResult { #[cfg(test)] mod tests { use super::*; - use crate::ast::Pos; + use crate::reader::Pos; #[test] fn test_filename_with_password() { diff --git a/packages/hurl_core/src/parser/filter.rs b/packages/hurl_core/src/parser/filter.rs index 2dae34797..7cc53bb8d 100644 --- a/packages/hurl_core/src/parser/filter.rs +++ b/packages/hurl_core/src/parser/filter.rs @@ -207,8 +207,8 @@ fn xpath_filter(reader: &mut Reader) -> ParseResult { #[cfg(test)] mod tests { use super::*; - use crate::ast::Pos; use crate::parser::ParseErrorKind; + use crate::reader::Pos; #[test] fn test_count() { diff --git a/packages/hurl_core/src/parser/json.rs b/packages/hurl_core/src/parser/json.rs index 46900f6bb..b93398dbe 100644 --- a/packages/hurl_core/src/parser/json.rs +++ b/packages/hurl_core/src/parser/json.rs @@ -15,13 +15,13 @@ * limitations under the License. * */ -use crate::ast::{JsonListElement, JsonObjectElement, JsonValue, Pos, SourceInfo, Template}; +use crate::ast::{JsonListElement, JsonObjectElement, JsonValue, SourceInfo, Template}; use crate::parser::combinators::*; use crate::parser::error::*; use crate::parser::primitives::*; use crate::parser::template::*; use crate::parser::{expr, ParseResult}; -use crate::reader::Reader; +use crate::reader::{Pos, Reader}; pub fn parse(reader: &mut Reader) -> ParseResult { choice( diff --git a/packages/hurl_core/src/parser/key_string.rs b/packages/hurl_core/src/parser/key_string.rs index b01a522df..86a2d1132 100644 --- a/packages/hurl_core/src/parser/key_string.rs +++ b/packages/hurl_core/src/parser/key_string.rs @@ -151,8 +151,8 @@ fn key_string_escaped_char(reader: &mut Reader) -> ParseResult { #[cfg(test)] mod tests { - use super::*; + use crate::reader::Pos; #[test] fn test_key_string() { diff --git a/packages/hurl_core/src/parser/multiline.rs b/packages/hurl_core/src/parser/multiline.rs index e0d7027ba..f34d23296 100644 --- a/packages/hurl_core/src/parser/multiline.rs +++ b/packages/hurl_core/src/parser/multiline.rs @@ -263,6 +263,7 @@ fn oneline_string_value(reader: &mut Reader) -> ParseResult