You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: assert_checkcircuit.go
    path of file: ./repos/gnark/test
    
    the code of the file until where you have to start completion: package test

import (
	"github.com/consensys/gnark-crypto/ecc"
	"github.com/consensys/gnark/backend"
	"github.com/consensys/gnark/backend/groth16"
	"github.com/consensys/gnark/backend/plonk"
	"github.com/consensys/gnark/backend/witness"
	"github.com/consensys/gnark/constraint"
	"github.com/consensys/gnark/frontend"
	"github.com/consensys/gnark/frontend/schema"
	"github.com/consensys/gnark/test/unsafekzg"
)

// CheckCircuit performs a series of check on the provided circuit.
//
//	go test -short                  --> testEngineChecks
//	go test                         --> testEngineChecks  + constraintSolverChecks
//	go test -tags=prover_checks     --> ... + proverChecks
//	go test -tags=release_checks    --> ... + releaseChecks (solidity, serialization, ...)
//
// Depending on the above flags, the following checks are performed:
//   - the circuit compiles
//   - the circuit can be solved with the test engine
//   - the circuit can be solved with the constraint system solver
//   - the circuit can be solved with the
    
func (assert *Assert) parseAssignment(circuit frontend.Circuit, assignment frontend.Circuit, curve ecc.ID, checkSerialization bool) _witness {
	if assignment == nil {
		return _witness{}
	}
	full, err := frontend.NewWitness(assignment, curve.ScalarField())
	assert.NoError(err, "can't parse assignment into full witness")

	public, err := frontend.NewWitness(assignment, curve.ScalarField(), frontend.PublicOnly())
	assert.NoError(err, "can't parse assignment into public witness")

	if checkSerialization {
		witnessBuilder := func() any {
			w, err := witness.New(curve.ScalarField())
			if err != nil {
				panic(err)
			}
			return w
		}
		assert.roundTripCheck(full, witnessBuilder, "witness", "full")
		assert.roundTripCheck(public, witnessBuilder, "witness", "public")

		// count number of element in witness.
		// if too many, we don't do JSON serialization.
		s, err := schema.Walk(assignment, tVariable, nil)
		assert.NoError(err)

		if s.Public+s.Secret <= serializationThreshold {
			assert.Run(func(assert *Assert) {
				s := lazySchema(circuit)()
				assert.marshalWitnessJSON(full, s, curve, false)
			}, curve.String(), "marshal/json")
			assert.Run(func(assert *Assert) {
				s := lazySchema(circuit)()
				assert.marshalWitnessJSON(public, s, curve, true)
			}, curve.String(), "marshal-public/json")
		}
	}

	return _witness{full: full, public: public, assignment: assignment}
}