Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Aug 23, 2023
1 parent 6579c42 commit 7d97390
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -688,4 +688,5 @@ The following Cargo features are available:
- `type_chrono` - Implements schematic for the `chrono` crate.
- `type_regex` - Implements schematic for the `regex` crate.
- `type_relative_path` - Implements schematic for the `relative-path` crate.
- `type_semver` - Implements schematic for the `semver` crate.
- `type_url` - Implements schematic for the `url` crate.
1 change: 1 addition & 0 deletions crates/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ starbase_sandbox = "0.1.8"
chrono = { workspace = true }
regex = { workspace = true }
relative-path = { workspace = true, features = ["serde"] }
semver = { workspace = true, features = ["serde"] }
url = { workspace = true, features = ["serde"] }
2 changes: 2 additions & 0 deletions crates/config/tests/generator_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ struct GenConfig {
path: PathBuf,
rel_path: relative_path::RelativePathBuf,
url: Option<url::Url>,
version: Option<semver::Version>,
version_req: semver::VersionReq,
}

fn create_generator() -> SchemaGenerator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ expression: "fs::read_to_string(file).unwrap()"
"string",
"time",
"url",
"vector"
"vector",
"version",
"versionReq"
],
"properties": {
"boolean": {
Expand Down Expand Up @@ -90,6 +92,19 @@ expression: "fs::read_to_string(file).unwrap()"
"items": {
"type": "string"
}
},
"version": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"versionReq": {
"type": "string"
}
},
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ export interface GenConfig {
time: string;
url: string | null;
vector: string[];
version: string | null;
versionReq: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ export interface GenConfig {
time: string;
url: string | null;
vector: string[];
version: string | null;
versionReq: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ export interface GenConfig {
time: string;
url: string | null;
vector: string[];
version: string | null;
versionReq: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ export interface GenConfig {
time: string;
url: string | null;
vector: string[];
version: string | null;
versionReq: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ export interface GenConfig {
time: string;
url: string | null;
vector: string[];
version: string | null;
versionReq: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ export interface GenConfig {
time: string;
url: string | null;
vector: string[];
version: string | null;
versionReq: string;
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ export type GenConfig = {
time: string,
url: string | null,
vector: string[],
version: string | null,
versionReq: string,
};

Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ export interface GenConfig {
time: string;
url: string | null;
vector: string[];
version: string | null;
versionReq: string;
}

0 comments on commit 7d97390

Please sign in to comment.