MCPcopy
hub / github.com/github/gh-ost / TestSameFirstColumnValue

Function TestSameFirstColumnValue

go/sql/builder_test.go:584–603  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

582}
583
584func TestSameFirstColumnValue(t *testing.T) {
585 {
586 // Identical integer values match.
587 require.True(t, sameFirstColumnValue([]interface{}{3, 17}, []interface{}{3, 117}))
588 }
589 {
590 // Different integer values do not match.
591 require.False(t, sameFirstColumnValue([]interface{}{3, 17}, []interface{}{4, 17}))
592 }
593 {
594 // Identical string values match.
595 require.True(t, sameFirstColumnValue([]interface{}{"abc", 1}, []interface{}{"abc", 2}))
596 }
597 {
598 // fmt.Sprintf("%v", x) is the comparison key — int(3) and "3" stringify
599 // identically and are therefore treated as equal. This is intentional:
600 // real callers pass type-consistent args originating from the same row.
601 require.True(t, sameFirstColumnValue([]interface{}{3, 1}, []interface{}{"3", 2}))
602 }
603}
604
605func TestNewTwoColumnRangeMeta(t *testing.T) {
606 {

Callers

nothing calls this directly

Calls 1

sameFirstColumnValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…