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: duration_test.go
    path of file: ./repos/cosmos-sdk/orm/encoding/ormfield
    
    the code of the file until where you have to start completion: package ormfield_test

import (
	"bytes"
	"testing"
	"time"

	"google.golang.org/protobuf/reflect/protoreflect"
	"google.golang.org/protobuf/types/known/durationpb"
	"gotest.tools/v3/assert"

	"cosmossdk.io/orm/encoding/ormfield"
)

func TestDurationNil(t *testing.T) {
	t.Parallel()

	cdc := ormfield.DurationCodec{}
	buf := &bytes.Buffer{}
	assert.Ni
    
func TestDurationCompare(t *testing.T) {
	t.Parallel()
	cdc := ormfield.DurationCodec{}

	tt := []struct {
		name string
		dur1 *durationpb.Duration
		dur2 *durationpb.Duration
		want int
	}{
		{
			name: "equal",
			dur1: &durationpb.Duration{
				Seconds: 1,
				Nanos:   1,
			},
			dur2: &durationpb.Duration{
				Seconds: 1,
				Nanos:   1,
			},
			want: 0,
		},
		{
			name: "seconds equal, dur1 nanos less than dur2 nanos",
			dur1: &durationpb.Duration{
				Seconds: 1,
				Nanos:   1,
			},
			dur2: &durationpb.Duration{
				Seconds: 1,
				Nanos:   2,
			},
			want: -1,
		},
		{
			name: "seconds equal, dur1 nanos greater than dur2 nanos",
			dur1: &durationpb.Duration{
				Seconds: 1,
				Nanos:   2,
			},
			dur2: &durationpb.Duration{
				Seconds: 1,
				Nanos:   1,
			},
			want: 1,
		},
		{
			name: "seconds less than",
			dur1: &durationpb.Duration{
				Seconds: 1,
				Nanos:   1,
			},
			dur2: &durationpb.Duration{
				Seconds: 2,
				Nanos:   1,
			},
			want: -1,
		},
		{
			name: "seconds greater than",
			dur1: &durationpb.Duration{
				Seconds: 2,
				Nanos:   1,
			},
			dur2: &durationpb.Duration{
				Seconds: 1,
				Nanos:   1,
			},
			want: 1,
		},
		{
			name: "negative seconds equal, dur1 nanos less than dur2 nanos",
			dur1: &durationpb.Duration{
				Seconds: -1,
				Nanos:   -2,
			},
			dur2: &durationpb.Duration{
				Seconds: -1,
				Nanos:   -1,
			},
			want: -1,
		},
	}

	for _, tc := range tt {
		tc := tc
		t.Run(tc.name, func(t *testing.T) {
			t.Parallel()

			val1 := protoreflect.ValueOfMessage(tc.dur1.ProtoReflect())
			val2 := protoreflect.ValueOfMessage(tc.dur2.ProtoReflect())
			got := cdc.Compare(val1, val2)
			assert.Equal(t, tc.want, got, "Compare(%v, %v)", tc.dur1, tc.dur2)

			bz1 := encodeValue(t, cdc, val1)
			bz2 := encodeValue(t, cdc, val2)
			assert.Equal(t, tc.want, bytes.Compare(bz1, bz2), "bytes.Compare(%v, %v)", bz1, bz2)
		})
	}

	t.Run("nanos", func(t *testing.T) {
		t.Parallel()
		dur, err := time.ParseDuration("3879468295ns")
		assert.NilError(t, err)
		durPb := durationpb.New(dur)
		val := protoreflect.ValueOfMessage(durPb.ProtoReflect())
		buf := &bytes.Buffer{}
		assert.NilError(t, cdc.Encode(val, buf))
		assert.Equal(t, 9, len(buf.Bytes()))
		val2, err := cdc.Decode(buf)
		assert.NilError(t, err)
		assert.Equal(t, 0, cdc.Compare(val, val2))
	})
}