mirror of
https://github.com/dnlbauer/WHAM.git
synced 2026-09-10 22:25:31 +00:00
better error messages when reading timeseries
This commit is contained in:
11
tests/COLVAR_unparseable_1.xvg
Normal file
11
tests/COLVAR_unparseable_1.xvg
Normal file
@@ -0,0 +1,11 @@
|
||||
84.840004 -2.878293
|
||||
84.860004 -2.827750
|
||||
84.880004 -2.962375
|
||||
84.900004
|
||||
84.920004 -2.748589
|
||||
84.940004 -2.726197
|
||||
84.960004 -2.802982
|
||||
84.980004 -2.771980
|
||||
85.000004 -2.706482
|
||||
85.020004 -2.776983
|
||||
85.040004 -2.883180
|
||||
11
tests/COLVAR_unparseable_2.xvg
Normal file
11
tests/COLVAR_unparseable_2.xvg
Normal file
@@ -0,0 +1,11 @@
|
||||
84.840004 -2.878293
|
||||
84.860004 -2.827750
|
||||
84.880004 -2.962375
|
||||
84.900004 qwee
|
||||
84.920004 -2.748589
|
||||
84.940004 -2.726197
|
||||
84.960004 -2.802982
|
||||
84.980004 -2.771980
|
||||
85.000004 -2.706482
|
||||
85.020004 -2.776983
|
||||
85.040004 -2.883180
|
||||
@@ -77,6 +77,36 @@ mod integration {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unparseable_timeseries() {
|
||||
let output = Command::new("./target/debug/wham")
|
||||
.args(&["--bins", "100", "--min", "-3.0", "--max", "3.0", "-T", "300"])
|
||||
.args(&["-f", "tests/metadata_unparseable3.dat"])
|
||||
.args(&["-o", "/dev/null"])
|
||||
.output()
|
||||
.expect("failed to execute process");
|
||||
let output = String::from_utf8_lossy(&output.stderr);
|
||||
println!("{}", output);
|
||||
assert!(output.to_string().contains(
|
||||
"Failed to parse line"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unparseable_timeseries_empty() {
|
||||
let output = Command::new("./target/debug/wham")
|
||||
.args(&["--bins", "100", "--min", "-3.0", "--max", "3.0", "-T", "300"])
|
||||
.args(&["-f", "tests/metadata_unparseable4.dat"])
|
||||
.args(&["-o", "/dev/null"])
|
||||
.output()
|
||||
.expect("failed to execute process");
|
||||
let output = String::from_utf8_lossy(&output.stderr);
|
||||
println!("{}", output);
|
||||
assert!(output.to_string().contains(
|
||||
"Wrong number of columns in line"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wham_1d() {;
|
||||
Command::new("./target/debug/wham")
|
||||
|
||||
1
tests/metadata_unparseable3.dat
Normal file
1
tests/metadata_unparseable3.dat
Normal file
@@ -0,0 +1 @@
|
||||
COLVAR_unparseable_2.xvg -3.0 100
|
||||
1
tests/metadata_unparseable4.dat
Normal file
1
tests/metadata_unparseable4.dat
Normal file
@@ -0,0 +1 @@
|
||||
COLVAR_unparseable_1.xvg -3.0 100
|
||||
Reference in New Issue
Block a user