Skip to content

Commit

Permalink
test: add tests for rust_decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnisDa committed Oct 10, 2023
1 parent 266f26b commit eb8f60e
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/config/tests/generator_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct GenConfig {
// Types
date: chrono::NaiveDate,
datetime: chrono::NaiveDateTime,
decimal: rust_decimal::Decimal,
time: chrono::NaiveTime,
path: PathBuf,
rel_path: relative_path::RelativePathBuf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ expression: "fs::read_to_string(file).unwrap()"
"boolean",
"date",
"datetime",
"decimal",
"enums",
"float32",
"float64",
Expand Down Expand Up @@ -41,6 +42,10 @@ expression: "fs::read_to_string(file).unwrap()"
"type": "string",
"format": "date-time"
},
"decimal": {
"type": "string",
"format": "decimal"
},
"enums": {
"allOf": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GenConfig {
boolean: boolean;
date: string;
datetime: string;
decimal: string;
enums: BasicEnum;
float32: number;
float64: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface GenConfig {
boolean: boolean;
date: string;
datetime: string;
decimal: string;
enums: BasicEnum;
float32: number;
float64: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GenConfig {
boolean: boolean;
date: string;
datetime: string;
decimal: string;
enums: BasicEnum;
float32: number;
float64: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface GenConfig {
boolean: boolean;
date: string;
datetime: string;
decimal: string;
enums: BasicEnum;
float32: number;
float64: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface GenConfig {
boolean: boolean;
date: string;
datetime: string;
decimal: string;
enums: BasicEnum;
float32: number;
float64: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface GenConfig {
boolean: boolean;
date: string;
datetime: string;
decimal: string;
enums: 'foo' | 'bar' | 'baz';
float32: number;
float64: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type GenConfig = {
boolean: boolean,
date: string,
datetime: string,
decimal: string,
enums: BasicEnum,
float32: number,
float64: number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export interface GenConfig {
boolean: boolean;
date: string;
datetime: string;
decimal: string;
enums: BasicEnum;
float32: number;
float64: number;
Expand Down
2 changes: 2 additions & 0 deletions crates/test-app/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use chrono::NaiveDateTime;
use miette::Result;
use rust_decimal::Decimal;
use schematic::{Config, ConfigLoader, Format, ValidateError};
use serde::Serialize;

Expand Down Expand Up @@ -34,6 +35,7 @@ struct TestConfig {
#[setting(nested)]
nested: NestedConfig,
datetime: NaiveDateTime,
decimal: Decimal,
// regex: Regex,
}

Expand Down

0 comments on commit eb8f60e

Please sign in to comment.