Bump base64 to 0.22.1 (#12757)

# Description
Bumps `base64` to 0.22.1 which fixes the alphabet used for binhex
encoding and decoding. This required updating some test expected output.

Related to PR #12469 where `base64` was also bumped and ran into the
failing tests.

# User-Facing Changes
Bug fix, but still changes binhex encoding and decoding output.

# Tests + Formatting
Updated test expected output.
This commit is contained in:
Ian Manske
2024-05-04 12:56:16 +00:00
committed by GitHub
parent 0d6fbdde4a
commit 1e71cd4777
4 changed files with 10 additions and 10 deletions

View File

@ -281,7 +281,7 @@ mod tests {
#[test]
fn base64_decode_binhex() {
let word = Value::test_string("A5\"KC9jRB@IIF'8bF!");
let word = Value::test_string(r#"B5"LD@jSCAJJG'9cG!"#);
let expected = Value::binary(b"a binhex test".as_slice(), Span::test_data());
let actual = action(
@ -304,7 +304,7 @@ mod tests {
#[test]
fn base64_decode_binhex_with_new_line_input() {
let word = Value::test_string("A5\"KC9jRB\n@IIF'8bF!");
let word = Value::test_string("B5\"LD@jSC\nAJJG'9cG!");
let expected = Value::binary(b"a binhex test".as_slice(), Span::test_data());
let actual = action(

View File

@ -65,7 +65,7 @@ impl Command for EncodeBase64 {
Example {
description: "Encode a string with the binhex character set",
example: "'Some Data' | encode base64 --character-set binhex",
result: Some(Value::test_string(r#"7epXB5"%A@4J"#)),
result: Some(Value::test_string(r#"8fpYC5"%BA4K"#)),
},
]
}

View File

@ -15,7 +15,7 @@ fn base64_encode_characterset_binhex() {
echo 'username:password' | encode base64 --character-set binhex
"#);
assert_eq!(actual.out, "F@0NEPjJD97kE\'&bEhFZEP3");
assert_eq!(actual.out, "GA0PFQjKE@8kF'&cFhG[FQ3");
}
#[test]
@ -31,9 +31,9 @@ fn error_when_invalid_character_set_given() {
#[test]
fn base64_decode_characterset_binhex() {
let actual = nu!(r#"
echo "F@0NEPjJD97kE'&bEhFZEP3" | decode base64 --character-set binhex --binary | decode utf-8
"#);
let actual = nu!(
r#""GA0PFQjKE@8kF'&cFhG[FQ3" | decode base64 --character-set binhex --binary | decode utf-8"#
);
assert_eq!(actual.out, "username:password");
}