mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-09-21 18:57:33 +03:00
Add unit text for eval_html / encoding.
This commit is contained in:
parent
df9918bc40
commit
a2d91cc197
@ -4,4 +4,5 @@
|
||||
<span class="line"><span class="section-header">[Asserts]</span></span>
|
||||
<span class="line"><span class="query-type">xpath</span> <span class="string">"normalize-space(//data)"</span> <span class="predicate-type">==</span> <span class="string">"café"</span></span>
|
||||
<span class="line"><span class="query-type">xpath</span> <span class="string">"normalize-space(//data)"</span> <span class="predicate-type">==</span> <span class="string">"caf\u{e9}"</span></span>
|
||||
<span class="line"><span class="query-type">bytes</span> <span class="predicate-type">==</span> hex,<span class="hex">3c646174613e636166c3a93c2f646174613e</span>;</span>
|
||||
</span></span></code></pre>
|
||||
|
@ -4,3 +4,4 @@ HTTP 200
|
||||
[Asserts]
|
||||
xpath "normalize-space(//data)" == "café"
|
||||
xpath "normalize-space(//data)" == "caf\u{e9}"
|
||||
bytes == hex,3c646174613e636166c3a93c2f646174613e;
|
||||
|
@ -1 +1 @@
|
||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/utf8"},"response":{"status":200,"asserts":[{"query":{"type":"xpath","expr":"normalize-space(//data)"},"predicate":{"type":"equal","value":"café"}},{"query":{"type":"xpath","expr":"normalize-space(//data)"},"predicate":{"type":"equal","value":"café"}}]}}]}
|
||||
{"entries":[{"request":{"method":"GET","url":"http://localhost:8000/utf8"},"response":{"status":200,"asserts":[{"query":{"type":"xpath","expr":"normalize-space(//data)"},"predicate":{"type":"equal","value":"café"}},{"query":{"type":"xpath","expr":"normalize-space(//data)"},"predicate":{"type":"equal","value":"café"}},{"query":{"type":"bytes"},"predicate":{"type":"equal","value":"PGRhdGE+Y2Fmw6k8L2RhdGE+","encoding":"base64"}}]}}]}
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
set -Eeuo pipefail
|
||||
hurl tests_ok/utf8.hurl --verbose
|
||||
hurl tests_ok/utf8.hurl --very-verbose
|
||||
|
@ -283,13 +283,21 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cafe() {
|
||||
fn test_cafe_xml() {
|
||||
assert_eq!(
|
||||
eval_xml("<data>café</data>", "normalize-space(//data)").unwrap(),
|
||||
Value::String(String::from("café"))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cafe_html() {
|
||||
assert_eq!(
|
||||
eval_html("<data>café</data>", "normalize-space(//data)").unwrap(),
|
||||
Value::String(String::from("café"))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_html() {
|
||||
let html = r#"<html>
|
||||
|
Loading…
Reference in New Issue
Block a user