surrealpatch/sql/kill_test.go
2021-12-14 08:13:19 +00:00

65 lines
2.2 KiB
Go

// Code generated by https://github.com/abcum/tmpl
// Source file: kill.gen.go.tmpl
// DO NOT EDIT!
// Copyright © 2016 SurrealDB Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package sql
import (
"testing"
"time"
. "github.com/smartystreets/goconvey/convey"
)
func TestKill(t *testing.T) {
Convey("SelectStatement should have duration", t, func() {
So((&SelectStatement{}).Duration(), ShouldEqual, 0)
So((&SelectStatement{Timeout: 1 * time.Second}).Duration(), ShouldEqual, 1*time.Second)
})
Convey("CreateStatement should have duration", t, func() {
So((&CreateStatement{}).Duration(), ShouldEqual, 0)
So((&CreateStatement{Timeout: 1 * time.Second}).Duration(), ShouldEqual, 1*time.Second)
})
Convey("UpdateStatement should have duration", t, func() {
So((&UpdateStatement{}).Duration(), ShouldEqual, 0)
So((&UpdateStatement{Timeout: 1 * time.Second}).Duration(), ShouldEqual, 1*time.Second)
})
Convey("DeleteStatement should have duration", t, func() {
So((&DeleteStatement{}).Duration(), ShouldEqual, 0)
So((&DeleteStatement{Timeout: 1 * time.Second}).Duration(), ShouldEqual, 1*time.Second)
})
Convey("RelateStatement should have duration", t, func() {
So((&RelateStatement{}).Duration(), ShouldEqual, 0)
So((&RelateStatement{Timeout: 1 * time.Second}).Duration(), ShouldEqual, 1*time.Second)
})
Convey("InsertStatement should have duration", t, func() {
So((&InsertStatement{}).Duration(), ShouldEqual, 0)
So((&InsertStatement{Timeout: 1 * time.Second}).Duration(), ShouldEqual, 1*time.Second)
})
Convey("UpsertStatement should have duration", t, func() {
So((&UpsertStatement{}).Duration(), ShouldEqual, 0)
So((&UpsertStatement{Timeout: 1 * time.Second}).Duration(), ShouldEqual, 1*time.Second)
})
}