We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03800df commit a8999e8Copy full SHA for a8999e8
1 file changed
pineappl/src/packed_array.rs
@@ -1014,20 +1014,19 @@ mod tests {
1014
fn clear_if_empty() {
1015
let mut array = PackedArray::new(vec![40, 50, 50]);
1016
1017
+ // set something, which is not nothing
1018
array[[0,0,0]] = 1;
-
1019
+ assert!(!array.is_empty());
1020
+ array.clear_if_empty();
1021
assert!(!array.is_empty());
1022
1023
// setting the default value does not clear the array on it's own ...
1024
array[[0,0,0]] = 0;
1025
1026
assert_eq!(array.indexed_iter().count(),0);
1027
1028
// ... one needs to make that explicitly
1029
array.clear_if_empty();
1030
1031
assert!(array.is_empty());
1032
1033
}
0 commit comments