Skip to content

Commit

Permalink
Remove hex-literal crate dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyaaay authored and hurl-bot committed Jan 20, 2025
1 parent 0a6ee2f commit be6fbf9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/hurl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ curl-sys = "0.4.78"
encoding = "0.2.33"
glob = "0.3.2"
hex = "0.4.3"
hex-literal = "0.4.1"
hurl_core = { version = "6.1.0-SNAPSHOT", path = "../hurl_core" }
libflate = "2.1.0"
libxml = "0.3.3"
Expand Down
12 changes: 10 additions & 2 deletions packages/hurl/src/runner/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ impl Value {

#[cfg(test)]
pub mod tests {
use hex_literal::hex;
use hurl_core::ast::{SourceInfo, TemplateElement, Whitespace};
use hurl_core::reader::Pos;
use std::num::ParseIntError;

use super::*;
use crate::http::{HeaderVec, HttpError, HttpVersion};
Expand Down Expand Up @@ -1305,6 +1305,13 @@ pub mod tests {
);
}

fn decode_hex(s: &str) -> Result<Vec<u8>, ParseIntError> {
(0..s.len())
.step_by(2)
.map(|i| u8::from_str_radix(&s[i..i + 2], 16))
.collect()
}

#[test]
fn test_query_sha256() {
let variables = VariableSet::new();
Expand All @@ -1326,7 +1333,8 @@ pub mod tests {
.unwrap()
.unwrap(),
Value::Bytes(
hex!("a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb89").to_vec()
decode_hex("a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb89")
.unwrap()
)
);
}
Expand Down

0 comments on commit be6fbf9

Please sign in to comment.