Share Link
Copied to clipboard
Embed on Your Page
Copied to clipboard
We Stand with Ukraine
[Fork] [Fork] https://stackoverflow.com/questions/68682450/automatic-conversion-of-numbers-to-bools-migrating-from-newtonsoft-to-system-t by dbc_MinLength
Environment version: .NET 9.0.0 (9.0.0)
System.Text.Json version: System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51


Testing true... Results consistent: True
Testing false... Results consistent: False
Testing True... System.Text.Json failed: 'T' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
Newtonsoft.Json failed: Unexpected character encountered while parsing value: T. Path '', line 1, position 1.
Results consistent: Failed
Testing False... System.Text.Json failed: 'F' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
Newtonsoft.Json failed: Unexpected character encountered while parsing value: F. Path '', line 1, position 1.
Results consistent: Failed
Testing "True"... Results consistent: True
Testing "False"... Results consistent: False
Testing "TRUE"... Results consistent: True
Testing "FALSE"... Results consistent: False
Testing "true"... Results consistent: True
Testing "false"... Results consistent: False
Testing ""... Results consistent: Failed
Testing "   "... System.Text.Json failed: The JSON value could not be converted to System.Boolean. Path: $ | LineNumber: 0 | BytePositionInLine: 5.
Newtonsoft.Json failed: Could not convert string to boolean:    . Path '', line 1, position 5.
Results consistent: Failed
Testing null... Results consistent: Failed

Testing 0... Results consistent: False
Testing 1... Results consistent: True
Testing 2... Results consistent: True
Testing 1.1... Results consistent: True
Testing -1... Results consistent: True
Testing 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111... Results consistent: True
Testing 11111111111111111111111111111111111111111111111111111111111111111111111111111111111... Results consistent: True
Testing 11111111111111111111111111111111111111111111111111111111111111111111111111111111111.0... Results consistent: True
Testing 111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222.0... Results consistent: True
Testing 0.000000... Results consistent: False
Testing 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001... Results consistent: True
Testing 4.94065645841247E-324... Results consistent: True
Testing 4.94065645841247E-326... Results consistent: False
Testing 1.7976931348623157E+308... Results consistent: True
Testing 1.7976931348623157E+309... Results consistent: True
Cached Result
Last Run: 11:21:17 pm
Compile: 0.024s
Execute: 0.23s
Memory: 23.17Mb
CPU: 0.254s