fix rust client test (#17124)

This commit is contained in:
William Cheng 2023-11-18 10:37:54 +08:00 committed by GitHub
parent 1ce95ff41e
commit eabd9401bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,19 @@
extern crate petstore_reqwest; extern crate petstore_reqwest;
use petstore_reqwest::models::TypeTesting; use petstore_reqwest::models::TypeTesting;
use uuid::Uuid;
#[test] #[test]
fn test_types() { fn test_types() {
let tt = TypeTesting::default(); let tt = TypeTesting {
int32: 123,
int64: 456,
float: 12.34,
double: 45.56,
string: String::from("something"),
boolean: true,
uuid: Uuid::new_v4()
};
assert_eq!(type_of(tt.int32), "i32"); assert_eq!(type_of(tt.int32), "i32");
assert_eq!(type_of(tt.int64), "i64"); assert_eq!(type_of(tt.int64), "i64");
assert_eq!(type_of(tt.float), "f32"); assert_eq!(type_of(tt.float), "f32");