From fd9c7b9cd6eb958027988002eb14085bbf255660 Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Wed, 11 Sep 2024 21:58:43 +0100 Subject: [PATCH] Remove ineffective no_std test It includes `extern crate std` so it's not actually testing no_std... --- schemars/tests/expected/no_std.json | 70 ----------------------------- schemars/tests/no_std.rs | 25 ----------- schemars/tests/util/mod.rs | 4 -- 3 files changed, 99 deletions(-) delete mode 100644 schemars/tests/expected/no_std.json delete mode 100644 schemars/tests/no_std.rs diff --git a/schemars/tests/expected/no_std.json b/schemars/tests/expected/no_std.json deleted file mode 100644 index 68da8900..00000000 --- a/schemars/tests/expected/no_std.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "MyStruct", - "type": "object", - "properties": { - "my_int": { - "type": "integer", - "format": "int32" - }, - "my_bool": { - "type": "boolean" - }, - "my_nullable_enum": { - "anyOf": [ - { - "$ref": "#/$defs/MyEnum" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "my_int", - "my_bool" - ], - "$defs": { - "MyEnum": { - "oneOf": [ - { - "type": "object", - "properties": { - "StringNewType": { - "type": "string" - } - }, - "required": [ - "StringNewType" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "StructVariant": { - "type": "object", - "properties": { - "floats": { - "type": "array", - "items": { - "type": "number", - "format": "float" - } - } - }, - "required": [ - "floats" - ] - } - }, - "required": [ - "StructVariant" - ], - "additionalProperties": false - } - ] - } - } -} \ No newline at end of file diff --git a/schemars/tests/no_std.rs b/schemars/tests/no_std.rs deleted file mode 100644 index c011aa29..00000000 --- a/schemars/tests/no_std.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![no_std] - -mod util; -use schemars::JsonSchema; -use util::*; - -extern crate alloc as test_alloc; - -#[derive(JsonSchema)] -pub struct MyStruct { - pub my_int: i32, - pub my_bool: bool, - pub my_nullable_enum: Option, -} - -#[derive(JsonSchema)] -pub enum MyEnum { - StringNewType(test_alloc::string::String), - StructVariant { floats: test_alloc::vec::Vec }, -} - -#[test] -fn no_std() -> TestResult { - test_default_generated_schema::("no_std") -} diff --git a/schemars/tests/util/mod.rs b/schemars/tests/util/mod.rs index ff67df65..381a4e79 100644 --- a/schemars/tests/util/mod.rs +++ b/schemars/tests/util/mod.rs @@ -1,11 +1,7 @@ use pretty_assertions::assert_eq; use schemars::{generate::SchemaSettings, schema_for, JsonSchema, Schema}; use std::error::Error; -use std::format; use std::fs; -use std::prelude::rust_2021::*; - -extern crate std; pub type TestResult = Result<(), Box>;