Change instances of Value::string("foo", Span::test_data()) to Value::test_string("foo") (#7592)

This commit is contained in:
Leon
2022-12-24 19:25:38 +10:00
committed by GitHub
parent 3d682fe957
commit 11bdab7e61
50 changed files with 191 additions and 235 deletions

View File

@ -180,8 +180,8 @@ mod tests {
#[test]
fn base64_encode_standard() {
let word = Value::string("Some Data Padding", Span::test_data());
let expected = Value::string("U29tZSBEYXRhIFBhZGRpbmc=", Span::test_data());
let word = Value::test_string("Some Data Padding");
let expected = Value::test_string("U29tZSBEYXRhIFBhZGRpbmc=");
let actual = action(
&word,
@ -203,8 +203,8 @@ mod tests {
#[test]
fn base64_encode_standard_no_padding() {
let word = Value::string("Some Data Padding", Span::test_data());
let expected = Value::string("U29tZSBEYXRhIFBhZGRpbmc", Span::test_data());
let word = Value::test_string("Some Data Padding");
let expected = Value::test_string("U29tZSBEYXRhIFBhZGRpbmc");
let actual = action(
&word,
@ -226,8 +226,8 @@ mod tests {
#[test]
fn base64_encode_url_safe() {
let word = Value::string("this is for url", Span::test_data());
let expected = Value::string("dGhpcyBpcyBmb3IgdXJs", Span::test_data());
let word = Value::test_string("this is for url");
let expected = Value::test_string("dGhpcyBpcyBmb3IgdXJs");
let actual = action(
&word,
@ -299,7 +299,7 @@ mod tests {
val: vec![77, 97, 110],
span: Span::test_data(),
};
let expected = Value::string("TWFu", Span::test_data());
let expected = Value::test_string("TWFu");
let actual = action(
&word,

View File

@ -52,7 +52,7 @@ impl Command for DecodeBase64 {
Example {
description: "Base64 decode a value and output as UTF-8 string",
example: "'U29tZSBEYXRh' | decode base64",
result: Some(Value::string("Some Data", Span::test_data())),
result: Some(Value::test_string("Some Data")),
},
Example {
description: "Base64 decode a value and output as binary",

View File

@ -44,12 +44,12 @@ impl Command for EncodeBase64 {
Example {
description: "Encode binary data",
example: "0x[09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0] | encode base64",
result: Some(Value::string("CfkRAp1041vYQVbFY1aIwA==", Span::test_data())),
result: Some(Value::test_string("CfkRAp1041vYQVbFY1aIwA==")),
},
Example {
description: "Encode a string with default settings",
example: "'Some Data' | encode base64",
result: Some(Value::string("U29tZSBEYXRh", Span::test_data())),
result: Some(Value::test_string("U29tZSBEYXRh")),
},
Example {
description: "Encode a string with the binhex character set",