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

Function TestConflictsRootObject

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

Source from the content-addressed store, hash-verified

21)
22
23func TestConflictsRootObject(t *testing.T) {
24 RunScripts(t, []ScriptTest{
25 {
26 Name: `Function delete "definition" conflict without modification`,
27 SetUpScript: []string{`CREATE FUNCTION interpreted_example(input TEXT) RETURNS TEXT AS $$ BEGIN RETURN '1' || input; END; $$ LANGUAGE plpgsql;`},
28 Assertions: []ScriptTestAssertion{
29 {
30 Query: "SELECT interpreted_example('12');",
31 Expected: []sql.Row{
32 {"112"},
33 },
34 },
35 {
36 Query: `SELECT dolt_add('.');`,
37 Expected: []sql.Row{{"{0}"}},
38 },
39 {
40 Query: "SELECT length(dolt_commit('-m', 'initial')::text) = 34;",
41 Expected: []sql.Row{{"t"}},
42 },
43 {
44 Query: `SELECT dolt_checkout('-b', 'other')`,
45 Expected: []sql.Row{{`{0,"Switched to branch 'other'"}`}},
46 },
47 {
48 Query: "CREATE OR REPLACE FUNCTION interpreted_example(input TEXT) RETURNS TEXT AS $$ BEGIN RETURN '3' || input; END; $$ LANGUAGE plpgsql;",
49 Expected: []sql.Row{},
50 },
51 {
52 Query: "SELECT interpreted_example('12');",
53 Expected: []sql.Row{
54 {"312"},
55 },
56 },
57 {
58 Query: `SELECT dolt_add('.');`,
59 Expected: []sql.Row{{"{0}"}},
60 },
61 {
62 Query: "SELECT length(dolt_commit('-m', 'other')::text) = 34;",
63 Expected: []sql.Row{{"t"}},
64 },
65 {
66 Query: `SELECT dolt_checkout('main')`,
67 Expected: []sql.Row{{`{0,"Switched to branch 'main'"}`}},
68 },
69 {
70 Query: "CREATE OR REPLACE FUNCTION interpreted_example(input TEXT) RETURNS INT2 AS $$ BEGIN RETURN '2' || input; END; $$ LANGUAGE plpgsql;",
71 Expected: []sql.Row{},
72 },
73 {
74 Query: "SELECT interpreted_example('12');",
75 Expected: []sql.Row{
76 {212},
77 },
78 },
79 {
80 Query: `SELECT * FROM dolt_status;`,

Callers

nothing calls this directly

Calls 2

RunScriptsFunction · 0.70
NumericFunction · 0.70

Tested by

no test coverage detected