Repository: prometheus/prometheus
File: tsdb/head_append_v2_test.go (Go)

Code before:
			appendableSamples: []appendableSamples{
				{ts: 100, fh: testFloatHistogram, st: 1},
				{ts: 102, fh: testFloatHistogram, st: 101},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, fh: testZeroFloatHistogram},
				sample{t: 100, fh: testFloatHistogram},
				sample{t: 101, fh: testZeroFloatHistogram},
				sample{t: 102, fh: testFloatHistogram},
			},
		},
		{
			name: "Consecutive appends with newer st do not ignore st/histogram",
			appendableSamples: []appendableSamples{
				{ts: 100, h: testNHCB, st: 1},
				{ts: 102, h: testNHCB, st: 101},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, h: testZeroNHCB},
				sample{t: 100, h: testNHCB},
				sample{t: 101, h: testZeroNHCB},
				sample{t: 102, h: testNHCB},
			},
		},
		{
			name: "Consecutive appends with newer st do not ignore st/floathistogram",
			appendableSamples: []appendableSamples{
				{ts: 100, fh: testFloatNHCB, st: 1},
				{ts: 102, fh: testFloatNHCB, st: 101},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, fh: testZeroFloatNHCB},
				sample{t: 100, fh: testFloatNHCB},
				sample{t: 101, fh: testZeroFloatNHCB},
				sample{t: 102, fh: testFloatNHCB},
			},
		},
		{
			name: "ST equals to previous sample timestamp is ignored/floatSample",
			appendableSamples: []appendableSamples{
				{ts: 100, fSample: 10, st: 1},
				{ts: 101, fSample: 10, st: 100},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, f: 0},
				sample{t: 100, f: 10},
				sample{t: 101, f: 10},
			},
		},
		{
			name: "ST equals to previous sample timestamp is ignored/histogram",

Review comment (suggestion):
```suggestion
			name: "Consecutive appends with newer st do not ignore st/floatNHCB",
```

Code after:
			appendableSamples: []appendableSamples{
				{ts: 100, fh: testFloatHistogram, st: 1},
				{ts: 102, fh: testFloatHistogram, st: 101},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, fh: testZeroFloatHistogram},
				sample{t: 100, fh: testFloatHistogram},
				sample{t: 101, fh: testZeroFloatHistogram},
				sample{t: 102, fh: testFloatHistogram},
			},
		},
		{
			name: "Consecutive appends with newer st do not ignore st/NHCB",
			appendableSamples: []appendableSamples{
				{ts: 100, h: testNHCB, st: 1},
				{ts: 102, h: testNHCB, st: 101},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, h: testZeroNHCB},
				sample{t: 100, h: testNHCB},
				sample{t: 101, h: testZeroNHCB},
				sample{t: 102, h: testNHCB},
			},
		},
		{
			name: "Consecutive appends with newer st do not ignore st/floatNHCB",
			appendableSamples: []appendableSamples{
				{ts: 100, fh: testFloatNHCB, st: 1},
				{ts: 102, fh: testFloatNHCB, st: 101},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, fh: testZeroFloatNHCB},
				sample{t: 100, fh: testFloatNHCB},
				sample{t: 101, fh: testZeroFloatNHCB},
				sample{t: 102, fh: testFloatNHCB},
			},
		},
		{
			name: "ST equals to previous sample timestamp is ignored/floatSample",
			appendableSamples: []appendableSamples{
				{ts: 100, fSample: 10, st: 1},
				{ts: 101, fSample: 10, st: 100},
			},
			expectedSamples: []chunks.Sample{
				sample{t: 1, f: 0},
				sample{t: 100, f: 10},
				sample{t: 101, f: 10},
			},
		},
		{
			name: "ST equals to previous sample timestamp is ignored/histogram",