Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for JSONEquals (0.09 sec)

  1. pkg/test/json.go

    // limitations under the License.
    
    package test
    
    import (
    	"bytes"
    	"encoding/json"
    )
    
    // JSONEquals compares two json strings. We cannot compare JSON strings from protobuf because of
    // design decisions https://github.com/golang/protobuf/issues/1373 Instead, use this function to
    // normalize the formatting
    func JSONEquals(t Failer, a, b string) {
    	t.Helper()
    	ba := bytes.Buffer{}
    	if err := json.Compact(&ba, []byte(a)); err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 19 21:53:59 UTC 2021
    - 1.2K bytes
    - Viewed (0)
  2. pkg/kube/inject/app_probe_test.go

            "grpc": {
                "port": 1234,
                "service": "foo"
            },
            "timeoutSeconds": 10
        }
    }`,
    		},
    	} {
    		got := DumpAppProbers(tc.pod, 15020)
    		test.JSONEquals(t, got, tc.expected)
    	}
    }
    
    func TestPatchRewriteProbe(t *testing.T) {
    	svc := "foo"
    	annotations := map[string]string{}
    	statusPort := intstr.FromInt32(15020)
    	for _, tc := range []struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Aug 04 15:06:24 UTC 2023
    - 8.6K bytes
    - Viewed (0)
  3. pkg/bootstrap/config_test.go

    		}
    		// nolint: lll
    		want := `{"id":"test","cluster":"cluster","metadata":{"A":1,"B":{"b":1},"OWNER":"real-owner","PROXY_CONFIG":{"serviceCluster":"cluster"},"UNKNOWN":"new-field"}}`
    		test.JSONEquals(t, want, string(b))
    	}
    
    	node2 := ConvertXDSNodeToNode(out)
    	{
    		got, err := json.Marshal(node2)
    		if err != nil {
    			t.Fatalf("failed to marshal: %v", err)
    		}
    		// nolint: lll
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Mar 28 20:38:02 UTC 2024
    - 9.1K bytes
    - Viewed (0)
Back to top