Skip to content

Commit

Permalink
check invalid merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Jun 7, 2024
1 parent e77dfb0 commit fa9c89c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/data/model_merge_invalid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
id-field: true
repo: "https://www.github.com/my/repo/"
prefix: "tst"
prefixes:
schema: http://schema.org/
nsmap:
tst: http://example.com/test/
---

### Test

- __other__
- Type: string

### Ontology

```
OTHER = "Something other"
```
13 changes: 13 additions & 0 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,17 @@ mod tests {
assert!(enum_names.contains(&"Ontology".to_string()));
assert!(enum_names.contains(&"AddedEnum".to_string()));
}

#[test]
#[should_panic]
fn test_model_merge_invalid() {
// Arrange
let path = Path::new("tests/data/model.md");
let mut model = DataModel::from_markdown(path).expect("Could not parse markdown");
let path2 = Path::new("tests/data/model_merge_invalid.md");
let model2 = DataModel::from_markdown(path2).expect("Could not parse markdown");

// Act
model.merge(&model2);
}
}

0 comments on commit fa9c89c

Please sign in to comment.