Fix tests

This commit is contained in:
bjorn3
2021-10-10 15:00:25 +02:00
parent aa0486eb15
commit 355dd996a2

View File

@@ -337,22 +337,6 @@ mod tests {
sut.get(a); // panics, only use constants returned by ConstantPool sut.get(a); // panics, only use constants returned by ConstantPool
} }
#[test]
fn get_offset() {
let mut sut = ConstantPool::new();
let a = sut.insert(vec![1].into());
sut.set_offset(a, 42);
assert_eq!(sut.get_offset(a), 42)
}
#[test]
#[should_panic]
fn get_nonexistent_offset() {
let mut sut = ConstantPool::new();
let a = sut.insert(vec![1].into());
sut.get_offset(a); // panics, set_offset should have been called
}
#[test] #[test]
fn display_constant_data() { fn display_constant_data() {
assert_eq!(ConstantData::from([0].as_ref()).to_string(), "0x00"); assert_eq!(ConstantData::from([0].as_ref()).to_string(), "0x00");