Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 88 for test_0 (0.17 sec)

  1. .github/labels.json

          "colour": "#43952A",
          "description": "has pull request"
        },
        "not_tested": {
          "name": "type:not tested",
          "colour": "#CF2E1F",
          "description": "not tested"
        },
        "tested": {
          "name": "type:tested",
          "colour": "#00ff00",
          "description": "tested"
        },
        "breaking_change": {
          "name": "type:breaking change",
          "colour": "#CF2E1F",
    Json
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 19 03:49:03 GMT 2020
    - 3.8K bytes
    - Viewed (0)
  2. schema/callbacks_test.go

    package schema_test
    
    import (
    	"reflect"
    	"sync"
    	"testing"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/schema"
    )
    
    type UserWithCallback struct{}
    
    func (UserWithCallback) BeforeSave(*gorm.DB) error {
    	return nil
    }
    
    func (UserWithCallback) AfterCreate(*gorm.DB) error {
    	return nil
    }
    
    func TestCallback(t *testing.T) {
    	user, err := schema.Parse(&UserWithCallback{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 939 bytes
    - Viewed (0)
  3. clause/where_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestWhere(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Where{
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  4. clause/from_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestFrom(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}},
    			"SELECT * FROM `users`", nil,
    		},
    		{
    			[]clause.Interface{
    				clause.Select{}, clause.From{
    					Tables: []clause.Table{{Name: "users"}},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  5. tests/update_test.go

    package tests_test
    
    import (
    	"errors"
    	"regexp"
    	"sort"
    	"strings"
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestUpdate(t *testing.T) {
    	var (
    		users = []*User{
    			GetUser("update-1", Config{}),
    			GetUser("update-2", Config{}),
    			GetUser("update-3", Config{}),
    		}
    		user          = users[1]
    		lastUpdatedAt time.Time
    	)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  6. schema/index_test.go

    	CheckIndices(t, map[string]schema.Index{
    		"idx_index_tests_field_a": {
    			Name:   "idx_index_tests_field_a",
    			Fields: []schema.IndexOption{{Field: &schema.Field{Name: "FieldA", Unique: true}}},
    		},
    		"idx_index_tests_field_c": {
    			Name:   "idx_index_tests_field_c",
    			Class:  "UNIQUE",
    			Fields: []schema.IndexOption{{Field: &schema.Field{Name: "FieldC", UniqueIndex: "idx_index_tests_field_c"}}},
    		},
    		"idx_index_tests_field_d": {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  7. tests/transaction_test.go

    package tests_test
    
    import (
    	"context"
    	"errors"
    	"testing"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestTransaction(t *testing.T) {
    	tx := DB.Begin()
    	user := *GetUser("transaction", Config{})
    
    	if err := tx.Save(&user).Error; err != nil {
    		t.Fatalf("No error should raise, but got %v", err)
    	}
    
    	if err := tx.First(&User{}, "name = ?", "transaction").Error; err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  8. tests/scan_test.go

    package tests_test
    
    import (
    	"reflect"
    	"sort"
    	"strings"
    	"testing"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    type PersonAddressInfo struct {
    	Person  *Person  `gorm:"embedded"`
    	Address *Address `gorm:"embedded"`
    }
    
    func TestScan(t *testing.T) {
    	user1 := User{Name: "ScanUser1", Age: 1}
    	user2 := User{Name: "ScanUser2", Age: 10}
    	user3 := User{Name: "ScanUser3", Age: 20}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat May 28 14:18:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  9. tests/helper_test.go

    package tests_test
    
    import (
    	"os"
    	"sort"
    	"strconv"
    	"strings"
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    
    	. "gorm.io/gorm/utils/tests"
    )
    
    type Config struct {
    	Account   bool
    	Pets      int
    	Toys      int
    	Company   bool
    	Manager   bool
    	Team      int
    	Languages int
    	Friends   int
    	NamedPet  bool
    	Tools     int
    }
    
    func GetUser(name string, config Config) *User {
    	var (
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  10. clause/group_by_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestGroupBy(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.GroupBy{
    				Columns: []clause.Column{{Name: "role"}},
    				Having:  []clause.Expression{clause.Eq{"role", "admin"}},
    			}},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.1K bytes
    - Viewed (0)
Back to top