summaryrefslogtreecommitdiff
path: root/src/rust/protover/tests/protover.rs
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-12 17:25:40 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-12 17:25:40 -0400
commitf308e81fa755efd405919d66bd59c873de325276 (patch)
tree4b7c0f83f22d10904b64740fc4539e81007b1f60 /src/rust/protover/tests/protover.rs
parentb4f20ec8a634dc734b103b1773d6565c876e7a24 (diff)
parentf8d5fb42a392a764da9f46102583ea2dff960939 (diff)
downloadtor-f308e81fa755efd405919d66bd59c873de325276.tar.gz
tor-f308e81fa755efd405919d66bd59c873de325276.zip
Merge branch 'maint-0.3.4'
Diffstat (limited to 'src/rust/protover/tests/protover.rs')
-rw-r--r--src/rust/protover/tests/protover.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rust/protover/tests/protover.rs b/src/rust/protover/tests/protover.rs
index a091e692d6..5d6c2c9e70 100644
--- a/src/rust/protover/tests/protover.rs
+++ b/src/rust/protover/tests/protover.rs
@@ -106,10 +106,10 @@ fn protocol_all_supported_with_unsupported_versions() {
#[test]
fn protocol_all_supported_with_unsupported_low_version() {
- let protocols: UnvalidatedProtoEntry = "Cons=0-1".parse().unwrap();
+ let protocols: UnvalidatedProtoEntry = "HSIntro=2-3".parse().unwrap();
let unsupported: Option<UnvalidatedProtoEntry> = protocols.all_supported();
assert_eq!(true, unsupported.is_some());
- assert_eq!("Cons=0", &unsupported.unwrap().to_string());
+ assert_eq!("HSIntro=2", &unsupported.unwrap().to_string());
}
#[test]
@@ -364,18 +364,18 @@ fn protover_all_supported_should_exclude_some_versions_and_entire_protocols() {
#[test]
fn protover_all_supported_should_not_dos_anyones_computer() {
- let proto: UnvalidatedProtoEntry = "Sleen=0-2147483648".parse().unwrap();
+ let proto: UnvalidatedProtoEntry = "Sleen=1-2147483648".parse().unwrap();
let result: String = proto.all_supported().unwrap().to_string();
- assert_eq!(result, "Sleen=0-2147483648".to_string());
+ assert_eq!(result, "Sleen=1-2147483648".to_string());
}
#[test]
fn protover_all_supported_should_not_dos_anyones_computer_max_versions() {
- let proto: UnvalidatedProtoEntry = "Sleen=0-4294967294".parse().unwrap();
+ let proto: UnvalidatedProtoEntry = "Sleen=1-4294967294".parse().unwrap();
let result: String = proto.all_supported().unwrap().to_string();
- assert_eq!(result, "Sleen=0-4294967294".to_string());
+ assert_eq!(result, "Sleen=1-4294967294".to_string());
}
#[test]
@@ -398,7 +398,7 @@ fn protover_unvalidatedprotoentry_should_err_entirely_unparseable_things() {
#[test]
fn protover_all_supported_over_maximum_limit() {
- let proto: Result<UnvalidatedProtoEntry, ProtoverError> = "Sleen=0-4294967295".parse();
+ let proto: Result<UnvalidatedProtoEntry, ProtoverError> = "Sleen=1-4294967295".parse();
assert_eq!(Err(ProtoverError::ExceedsMax), proto);
}