============================================================================= GetBoolean partial literal (SYS-REQ-079) ============================================================================= Verifies: SYS-REQ-079 [boundary] GetBoolean on partial boolean literal shall return error.
(t *testing.T)
| 781 | // Verifies: SYS-REQ-079 [boundary] |
| 782 | // GetBoolean on partial boolean literal shall return error. |
| 783 | func TestGetBooleanPartialLiteral(t *testing.T) { |
| 784 | // When a value is something like "tru" (not a real boolean), Get classifies it |
| 785 | // differently (Number or Unknown) and GetBoolean returns a type error. |
| 786 | _, err := GetBoolean([]byte(`{"a":1}`), "a") |
| 787 | if err == nil { |
| 788 | t.Fatal("GetBoolean on numeric value should return error") |
| 789 | } |
| 790 | |
| 791 | _, err = GetBoolean([]byte(`{"a":"true"}`), "a") |
| 792 | if err == nil { |
| 793 | t.Fatal("GetBoolean on string 'true' should return error") |
| 794 | } |
| 795 | } |
| 796 | |
| 797 | // ============================================================================= |
| 798 | // GetUnsafeString edge cases (SYS-REQ-080, SYS-REQ-081, SYS-REQ-082) |
nothing calls this directly
no test coverage detected