Skip to content

Commit

Permalink
feat: test ToSChema
Browse files Browse the repository at this point in the history
  • Loading branch information
batleforc committed Aug 10, 2024
1 parent 237df04 commit 7264869
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
6 changes: 6 additions & 0 deletions libs/markdown_struct/src/blog_timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,10 @@ mod tests {
.unwrap();
assert_eq!(short_page.name, "test_page");
}

#[test]
fn test_blog_timeline_to_schema() {
let schema = BlogTimeline::schema();
assert_eq!(schema.0, "BlogTimeline");
}
}
8 changes: 8 additions & 0 deletions libs/markdown_struct/src/content_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,12 @@ mod tests {
let deserialized: PageShort = serde_json::from_str(&serialized).unwrap();
assert_eq!(page_short, deserialized);
}

#[test]
fn test_page_to_schema() {
let schema_page = Page::schema();
let schema_page_short = PageShort::schema();
assert_eq!(schema_page.0, "Page".to_string());
assert_eq!(schema_page_short.0, "PageShort".to_string());
}
}
11 changes: 11 additions & 0 deletions libs/markdown_struct/src/doc_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,15 @@ THIS IS A TEST
}
);
}

#[test]
fn test_header_schema() {
let schema_header_spec = DocHeaderSpec::schema();
let schema_header_link = DocHeaderLink::schema();
let schema_header = DocHeader::schema();

assert_eq!(schema_header_spec.0, "DocHeaderSpec");
assert_eq!(schema_header_link.0, "DocHeaderLink");
assert_eq!(schema_header.0, "DocHeader");
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"rust:test":"cargo llvm-cov --open --ignore-filename-regex 'init'"
"rust:test":"cargo llvm-cov --open --ignore-filename-regex 'init'",
"rust:start": "podman compose up -d && cargo run"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit 7264869

Please sign in to comment.