Skip to content

Commit f6da32a

Browse files
committed
Adapt error handling and add tests für empty SMARTS
1 parent d12879f commit f6da32a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/test_graphmol.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::io::ErrorKind;
21
use rdkit::{
32
detect_chemistry_problems, fragment_parent, substruct_match, CleanupParameters,
43
MolSanitizeException, ROMol, ROMolError, RWMol, SmilesParserParams, SubstructMatchParameters,
@@ -300,6 +299,14 @@ fn test_building_rwmol_from_smarts() {
300299
fn test_building_rwmol_from_invalid_smarts() {
301300
let smarts = "string";
302301
let e =RWMol::from_smarts(smarts).unwrap_err();
303-
assert_eq!(e.kind(), ErrorKind::InvalidData);
302+
assert_eq!(e, "invalid SMARTS");
304303

305304
}
305+
306+
#[test]
307+
fn test_building_rwmol_from_empty_smarts() {
308+
let smarts = "";
309+
let e =RWMol::from_smarts(smarts).unwrap_err();
310+
assert_eq!(e, "empty SMARTS");
311+
312+
}

0 commit comments

Comments
 (0)