Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 4,145 for _test (0.25 sec)

  1. 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 21 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 939 bytes
    - Viewed (0)
  2. 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 21 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  3. tensorflow/c/eager/gradients_test.cc

          "or NotDifferentiableGradientFunction.",
          s.message());
      ASSERT_EQ(nullptr, outputs[0]);
    }
    
    // TODO(b/164171226): Enable this test with tfrt after AddInputList is
    // supported. It is needed for IdentityN.
    #ifdef PLATFORM_GOOGLE
    INSTANTIATE_TEST_SUITE_P(
        UnifiedCAPI, CppGradients,
        ::testing::Combine(::testing::Values("graphdef", "mlir"),
                           /*tfrt*/ ::testing::Values(false),
    C++
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Thu Feb 15 09:49:45 GMT 2024
    - 7K bytes
    - Viewed (0)
  4. src/bytes/boundary_test.go

    // Copyright 2017 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    //
    //go:build linux
    
    package bytes_test
    
    import (
    	. "bytes"
    	"syscall"
    	"testing"
    )
    
    // This file tests the situation where byte operations are checking
    // data very near to a page boundary. We want to make sure those
    // operations do not read across the boundary and cause a page
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Nov 30 20:05:58 GMT 2023
    - 2.8K bytes
    - Viewed (0)
  5. clause/values_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestValues(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{
    				clause.Insert{},
    				clause.Values{
    					Columns: []clause.Column{{Name: "name"}, {Name: "age"}},
    					Values:  [][]interface{}{{"jinzhu", 18}, {"josh", 1}},
    				},
    			},
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 691 bytes
    - Viewed (0)
  6. src/arena/arena_test.go

    // Copyright 2022 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build goexperiment.arenas
    
    package arena_test
    
    import (
    	"arena"
    	"testing"
    )
    
    type T1 struct {
    	n int
    }
    type T2 [1 << 20]byte // 1MiB
    
    func TestSmoke(t *testing.T) {
    	a := arena.NewArena()
    	defer a.Free()
    
    	tt := arena.New[T1](a)
    	tt.n = 1
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Oct 12 20:23:36 GMT 2022
    - 742 bytes
    - Viewed (0)
  7. src/cmd/addr2line/addr2line_test.go

    	}
    	fi1, err := os.Stat("addr2line_test.go")
    	if err != nil {
    		t.Fatalf("Stat failed: %v", err)
    	}
    
    	// Debug paths are stored slash-separated, so convert to system-native.
    	srcPath = filepath.FromSlash(srcPath)
    	fi2, err := os.Stat(srcPath)
    
    	if err != nil {
    		t.Fatalf("Stat failed: %v", err)
    	}
    	if !os.SameFile(fi1, fi2) {
    		t.Fatalf("addr2line_test.go and %s are not same file", srcPath)
    	}
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Feb 21 22:16:54 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  8. clause/set_test.go

    package clause_test
    
    import (
    	"fmt"
    	"sort"
    	"strings"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestSet(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{
    				clause.Update{},
    				clause.Set([]clause.Assignment{{clause.PrimaryColumn, 1}}),
    			},
    			"UPDATE `users` SET `users`.`id`=?",
    			[]interface{}{1},
    		},
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  9. tests/benchmark_test.go

    package tests_test
    
    import (
    	"fmt"
    	"testing"
    
    	. "gorm.io/gorm/utils/tests"
    )
    
    func BenchmarkCreate(b *testing.B) {
    	user := *GetUser("bench", Config{})
    
    	for x := 0; x < b.N; x++ {
    		user.ID = 0
    		DB.Create(&user)
    	}
    }
    
    func BenchmarkFind(b *testing.B) {
    	user := *GetUser("find", Config{})
    	DB.Create(&user)
    
    	for x := 0; x < b.N; x++ {
    		DB.Find(&User{}, "id = ?", user.ID)
    	}
    }
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 01 03:50:57 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  10. src/archive/zip/example_test.go

    // Copyright 2012 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package zip_test
    
    import (
    	"archive/zip"
    	"bytes"
    	"compress/flate"
    	"fmt"
    	"io"
    	"log"
    	"os"
    )
    
    func ExampleWriter() {
    	// Create a buffer to write our archive to.
    	buf := new(bytes.Buffer)
    
    	// Create a new zip archive.
    	w := zip.NewWriter(buf)
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Jan 27 00:22:03 GMT 2016
    - 2K bytes
    - Viewed (0)
Back to top