Skip to content

Commit

Permalink
fix review & cockroach tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Weakky committed Sep 26, 2022
1 parent 4b79345 commit ff55d4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions psl/psl-core/src/datamodel_connector/int_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ pub enum IntType {
impl std::fmt::Display for IntType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
IntType::Signed8 => write!(f, "8-bit signed integer"),
IntType::Signed16 => write!(f, "16-bit signed integer"),
IntType::Signed24 => write!(f, "24-bit signed integer"),
IntType::Signed32 => write!(f, "32-bit signed integer"),
IntType::Unsigned8 => write!(f, "8-bit unsigned integer"),
IntType::Unsigned16 => write!(f, "16-bit unsigned integer"),
IntType::Unsigned24 => write!(f, "24-bit unsigned integer"),
IntType::Unsigned32 => write!(f, "32-bit unsigned integer"),
IntType::Signed8 => f.write_str("8-bit signed integer"),
IntType::Signed16 => f.write_str("16-bit signed integer"),
IntType::Signed24 => f.write_str("24-bit signed integer"),
IntType::Signed32 => f.write_str("32-bit signed integer"),
IntType::Unsigned8 => f.write_str("8-bit unsigned integer"),
IntType::Unsigned16 => f.write_str("16-bit unsigned integer"),
IntType::Unsigned24 => f.write_str("24-bit unsigned integer"),
IntType::Unsigned32 => f.write_str("32-bit unsigned integer"),
IntType::Custom(min, max) => write!(f, "custom integer (min: {}, max: {})", min, max),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,11 @@ mod max_integer {

// int4
insta::assert_snapshot!(
run_query!(&runner, format!("mutation {{ createOneTest(data: {{ id: 3, int4: {} }}) {{ id int }} }}", i32::MAX)),
run_query!(&runner, format!("mutation {{ createOneTest(data: {{ id: 3, int4: {} }}) {{ id int4 }} }}", i32::MAX)),
@r###"{"data":{"createOneTest":{"id":3,"int4":2147483647}}}"###
);
insta::assert_snapshot!(
run_query!(&runner, format!("mutation {{ createOneTest(data: {{ id: 4, int4: {} }}) {{ id int }} }}", i32::MIN)),
run_query!(&runner, format!("mutation {{ createOneTest(data: {{ id: 4, int4: {} }}) {{ id int4 }} }}", i32::MIN)),
@r###"{"data":{"createOneTest":{"id":4,"int4":-2147483648}}}"###
);

Expand Down

0 comments on commit ff55d4b

Please sign in to comment.