cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft7/multipleOf.json (about)

     1  [
     2  	{
     3  		"description": "by int",
     4  		"schema": {
     5  			"multipleOf": 2
     6  		},
     7  		"tests": [
     8  			{
     9  				"description": "int by int",
    10  				"data": 10,
    11  				"valid": true
    12  			},
    13  			{
    14  				"description": "int by int fail",
    15  				"data": 7,
    16  				"valid": false
    17  			},
    18  			{
    19  				"description": "ignores non-numbers",
    20  				"data": "foo",
    21  				"valid": true
    22  			}
    23  		]
    24  	},
    25  	{
    26  		"description": "by number",
    27  		"schema": {
    28  			"multipleOf": 1.5
    29  		},
    30  		"tests": [
    31  			{
    32  				"description": "zero is multiple of anything",
    33  				"data": 0,
    34  				"valid": true
    35  			},
    36  			{
    37  				"description": "4.5 is multiple of 1.5",
    38  				"data": 4.5,
    39  				"valid": true
    40  			},
    41  			{
    42  				"description": "35 is not multiple of 1.5",
    43  				"data": 35,
    44  				"valid": false
    45  			}
    46  		]
    47  	},
    48  	{
    49  		"description": "by small number",
    50  		"schema": {
    51  			"multipleOf": 0.0001
    52  		},
    53  		"tests": [
    54  			{
    55  				"description": "0.0075 is multiple of 0.0001",
    56  				"data": 0.0075,
    57  				"valid": true
    58  			},
    59  			{
    60  				"description": "0.00751 is not multiple of 0.0001",
    61  				"data": 0.00751,
    62  				"valid": false
    63  			}
    64  		]
    65  	},
    66  	{
    67  		"description": "float division = inf",
    68  		"schema": {
    69  			"type": "integer",
    70  			"multipleOf": 0.123456789
    71  		},
    72  		"tests": [
    73  			{
    74  				"description": "always invalid, but naive implementations may raise an overflow error",
    75  				"data": 1E+308,
    76  				"valid": false
    77  			}
    78  		]
    79  	},
    80  	{
    81  		"description": "small multiple of large integer",
    82  		"schema": {
    83  			"type": "integer",
    84  			"multipleOf": 1E-8
    85  		},
    86  		"tests": [
    87  			{
    88  				"description": "any integer is a multiple of 1e-8",
    89  				"data": 12391239123,
    90  				"valid": true
    91  			}
    92  		]
    93  	}
    94  ]