From fde463d17993b7f4aeaf73d51e1fbf8dba7bff1a Mon Sep 17 00:00:00 2001 From: Ryota Date: Mon, 17 Jul 2023 23:08:49 +0100 Subject: [PATCH] Correct to tabs --- helpers_test.go | 4 ++-- unmarshal_test.go | 50 +++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/helpers_test.go b/helpers_test.go index 6f20508..a6a22bc 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -24,7 +24,7 @@ func TestSimple(t *testing.T) { // _ = clean db.Prepare(t, ` - // Comment can be placed based on SurrealQL syntax. + // Comment can be placed based on SurrealQL syntax. // Dummy entry for database write testing. CREATE x:x SET x = "X"; @@ -38,7 +38,7 @@ func TestSimple(t *testing.T) { // SurrealDB will generate a random ID for this entry. CREATE user SET name = "John"; CREATE user SET name = "Johnny"; - `) + `) type User struct { Username string `json:"username,omitempty"` diff --git a/unmarshal_test.go b/unmarshal_test.go index a001e6f..682e7bc 100644 --- a/unmarshal_test.go +++ b/unmarshal_test.go @@ -21,7 +21,7 @@ func TestUnmarshal(t *testing.T) { prep := func(t testing.TB, db *surrealtest.SurrealDBTest) { db.Prepare(t, ` - // Comment can be placed based on SurrealQL syntax. + // Comment can be placed based on SurrealQL syntax. // Dummy entry for database write testing CREATE x:x SET x = "X"; @@ -35,7 +35,7 @@ func TestUnmarshal(t *testing.T) { // SurrealDB will generate a random ID for this entry. CREATE user:john SET name = "John"; CREATE user:johnny SET name = "Johnny"; - `) + `) } cases := map[string]struct { @@ -86,9 +86,9 @@ func TestUnmarshal(t *testing.T) { interaction: func(db *surrealtest.SurrealDBTest) (interface{}, error) { return db.Query( ` - CREATE user:j SET name = "J"; - CREATE user:jo SET name = "Jo"; - `, nil) + CREATE user:j SET name = "J"; + CREATE user:jo SET name = "Jo"; + `, nil) }, wantData: []User{ { @@ -105,10 +105,10 @@ func TestUnmarshal(t *testing.T) { interaction: func(db *surrealtest.SurrealDBTest) (interface{}, error) { return db.Query( ` - CREATE user:j SET name = "J"; - CREATE user:j SET name = "J"; // conflict - CREATE user SET name = "John"; - `, nil) + CREATE user:j SET name = "J"; + CREATE user:j SET name = "J"; // conflict + CREATE user SET name = "John"; + `, nil) }, wantErrorMsg: "Database record `user:j` already exists", }, @@ -116,11 +116,11 @@ func TestUnmarshal(t *testing.T) { interaction: func(db *surrealtest.SurrealDBTest) (interface{}, error) { return db.Query( ` - BEGIN TRANSACTION; - CREATE user:j SET name = "J"; - CREATE user:jo SET name = "Jo"; - COMMIT TRANSACTION; - `, nil) + BEGIN TRANSACTION; + CREATE user:j SET name = "J"; + CREATE user:jo SET name = "Jo"; + COMMIT TRANSACTION; + `, nil) }, wantData: []User{ { @@ -137,12 +137,12 @@ func TestUnmarshal(t *testing.T) { interaction: func(db *surrealtest.SurrealDBTest) (interface{}, error) { return db.Query( ` - BEGIN TRANSACTION; - CREATE user:j SET name = "J"; - CREATE user:j SET name = "J"; // conflict - CREATE user SET name = "John"; - COMMIT TRANSACTION; - `, nil) + BEGIN TRANSACTION; + CREATE user:j SET name = "J"; + CREATE user:j SET name = "J"; // conflict + CREATE user SET name = "John"; + COMMIT TRANSACTION; + `, nil) }, wantErrorMsg: "Database record `user:j` already exists", }, @@ -150,11 +150,11 @@ func TestUnmarshal(t *testing.T) { interaction: func(db *surrealtest.SurrealDBTest) (interface{}, error) { return db.Query( ` - BEGIN TRANSACTION; - CREATE user:j SET name = "J"; - CREATE user SET name = "John"; - CANCEL TRANSACTION; - `, nil) + BEGIN TRANSACTION; + CREATE user:j SET name = "J"; + CREATE user SET name = "John"; + CANCEL TRANSACTION; + `, nil) }, wantErrorMsg: "cancelled transaction", },