I was exploring the library and when I got to the tests it caught my attention as the tests have different name but the exact same code.
|
#[test] |
|
fn handshake_step_fails_if_state_is_not_initialized() { |
|
let mut state = State::NotInitialized(32); |
|
let actual = state.step_0().unwrap_err(); |
|
let expect = Error::NotInHandShakeState; |
|
assert_eq!(actual, expect); |
|
} |
|
|
|
#[test] |
|
fn handshake_step_fails_if_state_is_in_transport_mode() { |
|
let mut state = State::NotInitialized(32); |
|
let actual = state.step_0().unwrap_err(); |
|
let expect = Error::NotInHandShakeState; |
|
assert_eq!(actual, expect); |
|
} |
Also the second test's code doesn't seem to match its name, so perhaps someone duplicated the first while creating the second and then forgot to actually implement the new test. Just a hypothesis.
I was exploring the library and when I got to the tests it caught my attention as the tests have different name but the exact same code.
stratum/sv2/codec-sv2/src/lib.rs
Lines 287 to 301 in 6ab03af
Also the second test's code doesn't seem to match its name, so perhaps someone duplicated the first while creating the second and then forgot to actually implement the new test. Just a hypothesis.