Skip to content

Conversation

egonw
Copy link
Member

@egonw egonw commented Mar 16, 2025

  • missing test class
  • moved a few tests from test-module to just module
  • close of a Reader

Copy link

@egonw
Copy link
Member Author

egonw commented Mar 16, 2025

@@ -44,5 +44,6 @@ void testEthane() throws Exception {
ValidationReport report = engine.validateChemFile(chemFile);
Assertions.assertEquals(0, report.getErrorCount());
Assertions.assertEquals(0, report.getWarningCount());
reader.close();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All ok but this could be better written as:

try (MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT)) {
    ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());
    ValidatorEngine engine = new ValidatorEngine();
    engine.addValidator(new Geometry3DValidator());
    ValidationReport report = engine.validateChemFile(chemFile);
    Assertions.assertEquals(0, report.getErrorCount());
    Assertions.assertEquals(0, report.getWarningCount());
}

@johnmay johnmay merged commit 94505b7 into main Mar 16, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants