MCPcopy Create free account
hub / github.com/dolthub/doltgresql / TestOperators

Function TestOperators

testing/go/operators_test.go:23–4040  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func TestOperators(t *testing.T) {
24 RunScriptsWithoutNormalization(t, []ScriptTest{
25 {
26 Name: "Addition",
27 SetUpScript: []string{
28 "SET timezone TO 'UTC';",
29 },
30 Assertions: []ScriptTestAssertion{
31 {
32 Query: `SELECT 1::float4 + 2::float4;`,
33 Expected: []sql.Row{{float32(3)}},
34 },
35 {
36 Query: `SELECT 1::float4 + 2::float8;`,
37 Expected: []sql.Row{{float64(3)}},
38 },
39 {
40 Query: `SELECT 1::float4 + 2::int2;`,
41 Expected: []sql.Row{{float64(3)}},
42 },
43 {
44 Query: `SELECT 1::float4 + 2::int4;`,
45 Expected: []sql.Row{{float64(3)}},
46 },
47 {
48 Query: `SELECT 1::float4 + 2::int8;`,
49 Expected: []sql.Row{{float64(3)}},
50 },
51 {
52 Query: `SELECT 1::float4 + 2::numeric;`,
53 Expected: []sql.Row{{float64(3)}},
54 },
55 {
56 Query: `SELECT 1::float8 + 2::float4;`,
57 Expected: []sql.Row{{float64(3)}},
58 },
59 {
60 Query: `SELECT 1::float8 + 2::float8;`,
61 Expected: []sql.Row{{float64(3)}},
62 },
63 {
64 Query: `SELECT 1::float8 + 2::int2;`,
65 Expected: []sql.Row{{float64(3)}},
66 },
67 {
68 Query: `SELECT 1::float8 + 2::int4;`,
69 Expected: []sql.Row{{float64(3)}},
70 },
71 {
72 Query: `SELECT 1::float8 + 2::int8;`,
73 Expected: []sql.Row{{float64(3)}},
74 },
75 {
76 Query: `SELECT 1::float8 + 2::numeric;`,
77 Expected: []sql.Row{{float64(3)}},
78 },
79 {
80 Query: `SELECT 1::int2 + 2::float4;`,

Callers

nothing calls this directly

Calls 2

NumericFunction · 0.70

Tested by

no test coverage detected