Skip to content

Commit

Permalink
Merge branch 'main' into handle-input-empty
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorni authored Jan 4, 2024
2 parents ee2f279 + 9c7c795 commit c0144bd
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 156 deletions.
21 changes: 4 additions & 17 deletions src/decoders/atbash_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,7 @@ mod tests {
let result = atbash_decoder
.crack("583920482058430191", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
panic!("Decode_atbash did not return an option with Some<t>.")
} else {
// If we get here, the test passed
// Because the atbash_decoder.crack function returned None
// as it should do for the input
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -152,9 +145,7 @@ mod tests {
let result = atbash_decoder
.crack("", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -163,9 +154,7 @@ mod tests {
let result = atbash_decoder
.crack("hello good day!", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_some());
}

#[test]
Expand All @@ -174,8 +163,6 @@ mod tests {
let result = atbash_decoder
.crack("😂", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}
}
27 changes: 5 additions & 22 deletions src/decoders/base58_bitcoin_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,8 @@ mod tests {
#[test]
fn successful_decoding() {
let base58_bitcoin_decoder = Decoder::<Base58BitcoinDecoder>::new();

let result = base58_bitcoin_decoder.crack("StV1DL6CwTryKyV", &get_athena_checker());
let decoded_str = &result
.unencrypted_text
.expect("No unencrypted text for base58_bitcoin");
assert_eq!(decoded_str[0], "hello world");
assert_eq!(result.unencrypted_text.unwrap()[0], "hello world");
}

#[test]
Expand All @@ -145,14 +141,7 @@ mod tests {
&get_athena_checker(),
)
.unencrypted_text;
if result.is_some() {
panic!("Decode_base58_bitcoin did not return an option with Some<t>.")
} else {
// If we get here, the test passed
// Because the base58_bitcoin_decoder.crack function returned None
// as it should do for the input
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -161,9 +150,7 @@ mod tests {
let result = base58_bitcoin_decoder
.crack("", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -177,9 +164,7 @@ mod tests {
let result = base58_bitcoin_decoder
.crack("hello good day!", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -188,8 +173,6 @@ mod tests {
let result = base58_bitcoin_decoder
.crack("😂", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}
}
27 changes: 5 additions & 22 deletions src/decoders/base58_flickr_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,8 @@ mod tests {
#[test]
fn successful_decoding() {
let base58_flickr_decoder = Decoder::<Base58FlickrDecoder>::new();

let result = base58_flickr_decoder.crack("rTu1dk6cWsRYjYu", &get_athena_checker());
let decoded_str = &result
.unencrypted_text
.expect("No unencrypted text for base58_flickr");
assert_eq!(decoded_str[0], "hello world");
assert_eq!(result.unencrypted_text.unwrap()[0], "hello world");
}

#[test]
Expand All @@ -145,14 +141,7 @@ mod tests {
&get_athena_checker(),
)
.unencrypted_text;
if result.is_some() {
panic!("Decode_base58_flickr did not return an option with Some<t>.")
} else {
// If we get here, the test passed
// Because the base58_flickr_decoder.crack function returned None
// as it should do for the input
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -161,9 +150,7 @@ mod tests {
let result = base58_flickr_decoder
.crack("", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -177,9 +164,7 @@ mod tests {
let result = base58_flickr_decoder
.crack("hello good day!", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -188,8 +173,6 @@ mod tests {
let result = base58_flickr_decoder
.crack("😂", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}
}
27 changes: 5 additions & 22 deletions src/decoders/base58_monero_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,8 @@ mod tests {
#[test]
fn successful_decoding() {
let base58_monero_decoder = Decoder::<Base58MoneroDecoder>::new();

let result = base58_monero_decoder.crack("StV1DL6CwTryKyV", &get_athena_checker());
let decoded_str = &result
.unencrypted_text
.expect("No unencrypted text for base58_monero");
assert_eq!(decoded_str[0], "hello world");
assert_eq!(result.unencrypted_text.unwrap()[0], "hello world");
}

#[test]
Expand All @@ -145,14 +141,7 @@ mod tests {
&get_athena_checker(),
)
.unencrypted_text;
if result.is_some() {
panic!("Decode_base58_monero did not return an option with Some<t>.")
} else {
// If we get here, the test passed
// Because the base58_monero_decoder.crack function returned None
// as it should do for the input
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -161,9 +150,7 @@ mod tests {
let result = base58_monero_decoder
.crack("", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -177,9 +164,7 @@ mod tests {
let result = base58_monero_decoder
.crack("hello good day!", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -188,8 +173,6 @@ mod tests {
let result = base58_monero_decoder
.crack("😂", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}
}
27 changes: 5 additions & 22 deletions src/decoders/base58_ripple_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,8 @@ mod tests {
#[test]
fn successful_decoding() {
let base58_ripple_decoder = Decoder::<Base58RippleDecoder>::new();

let result = base58_ripple_decoder.crack("StVrDLaUATiyKyV", &get_athena_checker());
let decoded_str = &result
.unencrypted_text
.expect("No unencrypted text for base58_ripple");
assert_eq!(decoded_str[0], "hello world");
assert_eq!(result.unencrypted_text.unwrap()[0], "hello world");
}

#[test]
Expand All @@ -145,14 +141,7 @@ mod tests {
&get_athena_checker(),
)
.unencrypted_text;
if result.is_some() {
panic!("Decode_base58_ripple did not return an option with Some<t>.")
} else {
// If we get here, the test passed
// Because the base58_ripple_decoder.crack function returned None
// as it should do for the input
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -161,9 +150,7 @@ mod tests {
let result = base58_ripple_decoder
.crack("", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -177,9 +164,7 @@ mod tests {
let result = base58_ripple_decoder
.crack("hello good day!", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -188,8 +173,6 @@ mod tests {
let result = base58_ripple_decoder
.crack("😂", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}
}
27 changes: 5 additions & 22 deletions src/decoders/base91_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,8 @@ mod tests {
#[test]
fn successful_decoding() {
let base91_decoder = Decoder::<Base91Decoder>::new();

let result = base91_decoder.crack("TPwJh>Io2Tv!lE", &get_athena_checker());
let decoded_str = &result
.unencrypted_text
.expect("No unencrypted text for base91");
assert_eq!(decoded_str[0], "hello world");
assert_eq!(result.unencrypted_text.unwrap()[0], "hello world");
}

#[test]
Expand All @@ -137,14 +133,7 @@ mod tests {
let result = base91_decoder
.crack("😈", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
panic!("Decode_base91 did not return an option with Some<t>.")
} else {
// If we get here, the test passed
// Because the base91_decoder.crack function returned None
// as it should do for the input
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -153,9 +142,7 @@ mod tests {
let result = base91_decoder
.crack("", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}

#[test]
Expand All @@ -169,9 +156,7 @@ mod tests {
let result = base91_decoder
.crack("hello good day!", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_some());
}

#[test]
Expand All @@ -180,8 +165,6 @@ mod tests {
let result = base91_decoder
.crack("😂", &get_athena_checker())
.unencrypted_text;
if result.is_some() {
assert_eq!(true, true);
}
assert!(result.is_none());
}
}
Loading

0 comments on commit c0144bd

Please sign in to comment.