good morning!!!!

Skip to content
Snippets Groups Projects
Commit a0dd4121 authored by José Carlos Nieto's avatar José Carlos Nieto
Browse files

Adding test for select with Raw.

parent 85eb8243
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,27 @@ func TestSelectArtistNameFrom(t *testing.T) {
}
}
func TestSelectRawFrom(t *testing.T) {
var s, e string
var stmt Statement
stmt = Statement{
Type: SqlSelect,
Table: Table{`artist`},
Columns: Columns{
{`artist.name`},
{Raw{`CONCAT(artist.name, " ", artist.last_name)`}},
},
}
s = trim(stmt.Compile(defaultTemplate))
e = `SELECT "artist"."name", CONCAT(artist.name, " ", artist.last_name) FROM "artist"`
if s != e {
t.Fatalf("Got: %s, Expecting: %s", s, e)
}
}
func TestSelectFieldsFrom(t *testing.T) {
var s, e string
var stmt Statement
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment