(t *testing.T)
| 910 | } |
| 911 | |
| 912 | func TestScalarStringEdgeCases(t *testing.T) { |
| 913 | t.Parallel() |
| 914 | |
| 915 | tests := []struct { |
| 916 | name string |
| 917 | input any |
| 918 | expected string |
| 919 | }{ |
| 920 | {name: "nil", input: nil, expected: ""}, |
| 921 | {name: "empty string", input: "", expected: ""}, |
| 922 | {name: "normal string", input: "test", expected: "test"}, |
| 923 | {name: "whole number", input: float64(400), expected: "400"}, |
| 924 | {name: "decimal number", input: float64(3.14), expected: "3.14"}, |
| 925 | {name: "negative whole", input: float64(-500), expected: "-500"}, |
| 926 | {name: "zero", input: float64(0), expected: "0"}, |
| 927 | {name: "bool true", input: true, expected: "true"}, |
| 928 | {name: "bool false", input: false, expected: "false"}, |
| 929 | } |
| 930 | |
| 931 | for _, tt := range tests { |
| 932 | t.Run(tt.name, func(t *testing.T) { |
| 933 | t.Parallel() |
| 934 | assert.Equal(t, tt.expected, scalarString(tt.input)) |
| 935 | }) |
| 936 | } |
| 937 | } |
nothing calls this directly
no test coverage detected