// Code generated by testifylint/internal/testgen. DO NOT EDIT.

package encodedcompare

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http/httptest"
	"strings"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestEncodedCompareChecker(t *testing.T) {
	var respBody, raw, hexString, toJSON, expJSON, resultJSON, jsonb, resJson string
	var conf, expectedYAML, expYaml, ymlResult, yamlResult, expYML, outputYaml string
	var respBytes, resultJSONBytes []byte
	w := httptest.NewRecorder()
	var batch interface{ ParentSummary() []byte }
	var res [1]struct{ Data []byte }
	var output bytes.Buffer

	const expBody = `{"status":"healthy","message":"","peer_count":1}`

	// Invalid.
	{
		assert.Equal(t, `{"name":"name","value":1000}`, respBody)                                                                                             // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, `{"name":"name","value":1000}`, respBody, "msg with args %d %s", 42, "42")                                                           // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, expBody, respBody)                                                                                                                    // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, expBody, respBody, "msg with args %d %s", 42, "42")                                                                                  // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, `{"status":404,"message":"abc"}`, string(respBytes))                                                                                  // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, `{"status":404,"message":"abc"}`, string(respBytes), "msg with args %d %s", 42, "42")                                                // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, `{"message":"success"}`, w.Body.String())                                                                                             // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, `{"message":"success"}`, w.Body.String(), "msg with args %d %s", 42, "42")                                                           // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, "{\n  \"first\": \"Tobi\",\n  \"last\": \"Ferret\"\n}", string(w.Body.Bytes()))                                                       // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, "{\n  \"first\": \"Tobi\",\n  \"last\": \"Ferret\"\n}", string(w.Body.Bytes()), "msg with args %d %s", 42, "42")                     // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, "{\n\t\"msg\": \"hello world\"\n}", respBody)                                                                                         // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, "{\n\t\"msg\": \"hello world\"\n}", respBody, "msg with args %d %s", 42, "42")                                                       // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, fmt.Sprintf(`{"value":"%s","valuePtr":"%s"}`, hexString, hexString), string(respBytes))                                               // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, fmt.Sprintf(`{"value":"%s","valuePtr":"%s"}`, hexString, hexString), string(respBytes), "msg with args %d %s", 42, "42")             // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, `[{"@id":"a","b":[{"@id":"c"}]}]`, toJSON)                                                                                            // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, `[{"@id":"a","b":[{"@id":"c"}]}]`, toJSON, "msg with args %d %s", 42, "42")                                                          // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, "{\"FirstName\":\"john\",\"LastName\":\"doe\",\"Age\":26,\"Height\":182.88}", string(resJson))                                        // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, "{\"FirstName\":\"john\",\"LastName\":\"doe\",\"Age\":26,\"Height\":182.88}", string(resJson), "msg with args %d %s", 42, "42")      // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, expJSON, resultJSON)                                                                                                                  // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, expJSON, resultJSON, "msg with args %d %s", 42, "42")                                                                                // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, jsonb, respBody)                                                                                                                      // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, jsonb, respBody, "msg with args %d %s", 42, "42")                                                                                    // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, respBody, jsonb)                                                                                                                      // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, respBody, jsonb, "msg with args %d %s", 42, "42")                                                                                    // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, expJSON, resJson)                                                                                                                     // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, expJSON, resJson, "msg with args %d %s", 42, "42")                                                                                   // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, expectedYAML, conf)                                                                                                                   // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, expectedYAML, conf, "msg with args %d %s", 42, "42")                                                                                 // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, expYaml, conf)                                                                                                                        // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, expYaml, conf, "msg with args %d %s", 42, "42")                                                                                      // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, ymlResult, conf)                                                                                                                      // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, ymlResult, conf, "msg with args %d %s", 42, "42")                                                                                    // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, yamlResult, conf)                                                                                                                     // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, yamlResult, conf, "msg with args %d %s", 42, "42")                                                                                   // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, expYML, conf)                                                                                                                         // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, expYML, conf, "msg with args %d %s", 42, "42")                                                                                       // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, conf, expectedYAML)                                                                                                                   // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, conf, expectedYAML, "msg with args %d %s", 42, "42")                                                                                 // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, outputYaml, string(output.Bytes()))                                                                                                   // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, outputYaml, string(output.Bytes()), "msg with args %d %s", 42, "42")                                                                 // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, json.RawMessage(`{"uuid": "b65b1a22-db6d-4f5a-9b3d-7302368a82e6"}`), batch.ParentSummary())                                           // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, json.RawMessage(`{"uuid": "b65b1a22-db6d-4f5a-9b3d-7302368a82e6"}`), batch.ParentSummary(), "msg with args %d %s", 42, "42")         // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, res[0].Data, json.RawMessage([]byte(`{"name":"new"}`)))                                                                               // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, res[0].Data, json.RawMessage([]byte(`{"name":"new"}`)), "msg with args %d %s", 42, "42")                                             // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, json.RawMessage(raw), json.RawMessage(resultJSONBytes))                                                                               // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, json.RawMessage(raw), json.RawMessage(resultJSONBytes), "msg with args %d %s", 42, "42")                                             // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, json.RawMessage(raw), raw)                                                                                                            // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, json.RawMessage(raw), raw, "msg with args %d %s", 42, "42")                                                                          // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, json.RawMessage("{}"), respBody)                                                                                                      // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, json.RawMessage("{}"), respBody, "msg with args %d %s", 42, "42")                                                                    // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, respBody, json.RawMessage("null"))                                                                                                    // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, respBody, json.RawMessage("null"), "msg with args %d %s", 42, "42")                                                                  // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, json.RawMessage(`["more","raw","things"]`), resultJSONBytes)                                                                          // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, json.RawMessage(`["more","raw","things"]`), resultJSONBytes, "msg with args %d %s", 42, "42")                                        // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, "{}", string(resultJSONBytes))                                                                                                        // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, "{}", string(resultJSONBytes), "msg with args %d %s", 42, "42")                                                                      // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, []byte(expJSON), resultJSONBytes)                                                                                                     // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, []byte(expJSON), resultJSONBytes, "msg with args %d %s", 42, "42")                                                                   // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, []byte(expYaml), respBytes)                                                                                                           // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, []byte(expYaml), respBytes, "msg with args %d %s", 42, "42")                                                                         // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, expJSON, strings.Trim(string(resultJSONBytes), "\n"))                                                                                 // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, expJSON, strings.Trim(string(resultJSONBytes), "\n"), "msg with args %d %s", 42, "42")                                               // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, raw, strings.Replace(jsonb, "\n", "", -1))                                                                                            // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, raw, strings.Replace(jsonb, "\n", "", -1), "msg with args %d %s", 42, "42")                                                          // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, `{"status":"healthy","message":"","peer_count":1}`, strings.ReplaceAll(string(respBytes), " ", ""))                                   // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, `{"status":"healthy","message":"","peer_count":1}`, strings.ReplaceAll(string(respBytes), " ", ""), "msg with args %d %s", 42, "42") // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, `{"foo":"bar"}`, strings.TrimSpace(w.Body.String()))                                                                                  // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, `{"foo":"bar"}`, strings.TrimSpace(w.Body.String()), "msg with args %d %s", 42, "42")                                                // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, `{"bar":"foo"}`, strings.TrimSpace(string(w.Body.Bytes())))                                                                           // want "encoded-compare: use assert\\.JSONEq"
		assert.Equalf(t, `{"bar":"foo"}`, strings.TrimSpace(string(w.Body.Bytes())), "msg with args %d %s", 42, "42")                                         // want "encoded-compare: use assert\\.JSONEqf"
		assert.Equal(t, strings.TrimSpace(strings.ReplaceAll(expYaml, "\t", "  ")), strings.TrimSpace(string(respBytes)))                                     // want "encoded-compare: use assert\\.YAMLEq"
		assert.Equalf(t, strings.TrimSpace(strings.ReplaceAll(expYaml, "\t", "  ")), strings.TrimSpace(string(respBytes)), "msg with args %d %s", 42, "42")   // want "encoded-compare: use assert\\.YAMLEqf"
		assert.EqualValues(t, expJSON, resJson)                                                                                                               // want "encoded-compare: use assert\\.JSONEq"
		assert.EqualValuesf(t, expJSON, resJson, "msg with args %d %s", 42, "42")                                                                             // want "encoded-compare: use assert\\.JSONEqf"
		assert.Exactly(t, expJSON, resJson)                                                                                                                   // want "encoded-compare: use assert\\.JSONEq"
		assert.Exactlyf(t, expJSON, resJson, "msg with args %d %s", 42, "42")                                                                                 // want "encoded-compare: use assert\\.JSONEqf"
		assert.EqualValues(t, expYaml, conf)                                                                                                                  // want "encoded-compare: use assert\\.YAMLEq"
		assert.EqualValuesf(t, expYaml, conf, "msg with args %d %s", 42, "42")                                                                                // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Exactly(t, expYaml, conf)                                                                                                                      // want "encoded-compare: use assert\\.YAMLEq"
		assert.Exactlyf(t, expYaml, conf, "msg with args %d %s", 42, "42")                                                                                    // want "encoded-compare: use assert\\.YAMLEqf"
		assert.Equal(t, ` // want "encoded-compare: use assert\.JSONEq"
{
	"id": 123,
	"method": "get_prop",
	"params": ["power","sat"]
}
`, raw)
		assert.Equal(t, ` // want "encoded-compare: use assert\.JSONEq"
{
	"id": 123,
	"method": "get_prop",
	"params": ["power","sat"]
}
`, raw, "msg with args %d %s", 42, "42")
	}

	// Valid.
	{
		assert.JSONEq(t, `{"name":"name","value":1000}`, respBody)
		assert.JSONEqf(t, `{"name":"name","value":1000}`, respBody, "msg with args %d %s", 42, "42")
		assert.JSONEq(t, expJSON, resultJSON)
		assert.JSONEqf(t, expJSON, resultJSON, "msg with args %d %s", 42, "42")
		assert.JSONEq(t, `{"foo":"bar"}`, `{"foo":"bar"}`)
		assert.JSONEqf(t, `{"foo":"bar"}`, `{"foo":"bar"}`, "msg with args %d %s", 42, "42")
		assert.JSONEq(t, `{"message":"success"}`, w.Body.String())
		assert.JSONEqf(t, `{"message":"success"}`, w.Body.String(), "msg with args %d %s", 42, "42")
		assert.JSONEq(t, fmt.Sprintf(`{"value":"%s"}`, hexString), resJson)
		assert.JSONEqf(t, fmt.Sprintf(`{"value":"%s"}`, hexString), resJson, "msg with args %d %s", 42, "42")
		assert.JSONEq(t, "{\n  \"first\": \"Tobi\",\n  \"last\": \"Ferret\"\n}", w.Body.String())
		assert.JSONEqf(t, "{\n  \"first\": \"Tobi\",\n  \"last\": \"Ferret\"\n}", w.Body.String(), "msg with args %d %s", 42, "42")
		assert.YAMLEq(t, expYaml, conf)
		assert.YAMLEqf(t, expYaml, conf, "msg with args %d %s", 42, "42")
	}

	// Ignored.
	{
		assert.Equal(t, "{{ .StepName }}", "use", "command name incorrect")
		assert.Equalf(t, "{{ .StepName }}", "use", "command name incorrect", "msg with args %d %s", 42, "42")
		assert.Equal(t, json.RawMessage{}, respBody)
		assert.Equalf(t, json.RawMessage{}, respBody, "msg with args %d %s", 42, "42")
		assert.Equal(t, json.RawMessage(nil), respBody)
		assert.Equalf(t, json.RawMessage(nil), respBody, "msg with args %d %s", 42, "42")
		assert.Equal(t, raw, raw)
		assert.Equalf(t, raw, raw, "msg with args %d %s", 42, "42")
		assert.EqualValues(t, raw, raw)
		assert.EqualValuesf(t, raw, raw, "msg with args %d %s", 42, "42")
		assert.Exactly(t, raw, raw)
		assert.Exactlyf(t, raw, raw, "msg with args %d %s", 42, "42")
		assert.JSONEq(t, raw, raw)
		assert.JSONEqf(t, raw, raw, "msg with args %d %s", 42, "42")
		assert.Equal(t, string(respBytes), raw)
		assert.Equalf(t, string(respBytes), raw, "msg with args %d %s", 42, "42")
		assert.EqualValues(t, raw, string(respBytes))
		assert.EqualValuesf(t, raw, string(respBytes), "msg with args %d %s", 42, "42")
		assert.Exactly(t, string(respBytes), raw)
		assert.Exactlyf(t, string(respBytes), raw, "msg with args %d %s", 42, "42")
		assert.JSONEq(t, raw, string(respBytes))
		assert.JSONEqf(t, raw, string(respBytes), "msg with args %d %s", 42, "42")
		assert.NotEqual(t, raw, resultJSON)
		assert.NotEqualf(t, raw, resultJSON, "msg with args %d %s", 42, "42")
		assert.NotEqualValues(t, resultJSON, resultJSON)
		assert.NotEqualValuesf(t, resultJSON, resultJSON, "msg with args %d %s", 42, "42")
		assert.YAMLEq(t, `
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
images:
  - name: foo
    newName: bar
  - name: bar
    newName: baz
    newTag: "123"
`, conf)
		assert.YAMLEqf(t, `
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
images:
  - name: foo
    newName: bar
  - name: bar
    newName: baz
    newTag: "123"
`, conf, "msg with args %d %s", 42, "42")
		assert.YAMLEq(t, "kind: Kustomization", "kind: Kustomization")
		assert.YAMLEqf(t, "kind: Kustomization", "kind: Kustomization", "msg with args %d %s", 42, "42")
		assert.YAMLEq(t, raw, conf)
		assert.YAMLEqf(t, raw, conf, "msg with args %d %s", 42, "42")
		assert.YAMLEq(t, raw, string(respBytes))
		assert.YAMLEqf(t, raw, string(respBytes), "msg with args %d %s", 42, "42")
	}
}
