Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for deepEqual (0.32 sec)

  1. tests/scanner_valuer_test.go

    		t.Errorf("insert with sql.Expr, but got %v", stmt.SQL.String())
    	}
    
    	if !reflect.DeepEqual([]interface{}{"jinzhu", "POINT(100 100)"}, stmt.Vars) {
    		t.Errorf("generated vars is not equal, got %v", stmt.Vars)
    	}
    
    	stmt = dryRunDB.Model(UserWithPoint{}).Create(map[string]interface{}{
    		"Name":  "jinzhu",
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  2. tests/preload_suits_test.go

    	}
    
    	if len(got) != 2 {
    		t.Errorf("got %v items, expected 2", len(got))
    	}
    
    	if !reflect.DeepEqual(got[0], want) && !reflect.DeepEqual(got[1], want) {
    		t.Fatalf("got %s; want array containing %s", toJSONString(got), toJSONString(want))
    	}
    
    	if !reflect.DeepEqual(got[0], want2) && !reflect.DeepEqual(got[1], want2) {
    		t.Errorf("got %s; want array containing %s", toJSONString(got), toJSONString(want2))
    	}
    }
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Mar 18 05:38:46 GMT 2022
    - 30.3K bytes
    - Viewed (0)
  3. utils/utils.go

    }
    
    func Contains(elems []string, elem string) bool {
    	for _, e := range elems {
    		if elem == e {
    			return true
    		}
    	}
    	return false
    }
    
    func AssertEqual(x, y interface{}) bool {
    	if reflect.DeepEqual(x, y) {
    		return true
    	}
    	if x == nil || y == nil {
    		return false
    	}
    
    	xval := reflect.ValueOf(x)
    	yval := reflect.ValueOf(y)
    	if xval.Kind() == reflect.Ptr && xval.IsNil() ||
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  4. tests/hooks_test.go

    	DB.AutoMigrate(&Product{})
    
    	p := Product{Code: "unique_code", Price: 100}
    	DB.Save(&p)
    
    	if !reflect.DeepEqual(p.GetCallTimes(), []int64{1, 1, 0, 1, 1, 0, 0, 0, 0}) {
    		t.Fatalf("Callbacks should be invoked successfully, %v", p.GetCallTimes())
    	}
    
    	DB.Where("Code = ?", "unique_code").First(&p)
    	if !reflect.DeepEqual(p.GetCallTimes(), []int64{1, 1, 0, 1, 0, 0, 0, 0, 1}) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  5. tests/scan_test.go

    		}
    		results = append(results, result)
    	}
    
    	sort.Slice(results, func(i, j int) bool {
    		return strings.Compare(results[i].Name, results[j].Name) <= -1
    	})
    
    	if !reflect.DeepEqual(results, []Result{{Name: "ScanRowsUser2", Age: 10}, {Name: "ScanRowsUser3", Age: 20}}) {
    		t.Errorf("Should find expected results")
    	}
    
    	var ages int
    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)
  6. callbacks/create_test.go

    		Columns: []clause.Column{{Name: "name"}, {Name: "email"}, {Name: "age"}, {Name: "id"}},
    		Values: [][]interface{}{
    			{"alice", "email", 18, 1},
    			{"bob", "email", 19, 2},
    		},
    	}
    	if !reflect.DeepEqual(expected, values) {
    		t.Errorf("expected: %v got %v", expected, values)
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 05:48:42 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  7. statement_test.go

    			s1 := s.clone()
    			s1.AddClause(clause.Where{
    				Exprs: s.BuildCondition("FINAL1"),
    			})
    			s2 := s.clone()
    			s2.AddClause(clause.Where{
    				Exprs: s.BuildCondition("FINAL2"),
    			})
    
    			if reflect.DeepEqual(s1.Clauses["WHERE"], s2.Clauses["WHERE"]) {
    				t.Errorf("Where conditions should be different")
    			}
    		})
    	}
    }
    
    func TestNilCondition(t *testing.T) {
    	s := new(Statement)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Dec 23 13:19:41 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  8. tests/callbacks_test.go

    }
    
    func TestCallbacksGet(t *testing.T) {
    	db, _ := gorm.Open(nil, nil)
    	createCallback := db.Callback().Create()
    
    	createCallback.Before("*").Register("c1", c1)
    	if cb := createCallback.Get("c1"); reflect.DeepEqual(cb, c1) {
    		t.Errorf("callbacks tests failed, got: %p, want: %p", cb, c1)
    	}
    
    	createCallback.Remove("c1")
    	if cb := createCallback.Get("c2"); cb != nil {
    		t.Errorf("callbacks test failed. got: %p, want: nil", cb)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  9. utils/tests/utils.go

    		expect := ev.FieldByName(name).Interface()
    		t.Run(name, func(t *testing.T) {
    			AssertEqual(t, got, expect)
    		})
    	}
    }
    
    func AssertEqual(t *testing.T, got, expect interface{}) {
    	if !reflect.DeepEqual(got, expect) {
    		isEqual := func() {
    			if curTime, ok := got.(time.Time); ok {
    				format := "2006-01-02T15:04:05Z07:00"
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Mar 10 09:21:56 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  10. tests/multi_primary_keys_test.go

    	var tagContents []string
    	for _, tag := range tags {
    		tagContents = append(tagContents, tag.Value)
    	}
    	sort.Strings(tagContents)
    	sort.Strings(contents)
    	return reflect.DeepEqual(tagContents, contents)
    }
    
    func TestManyToManyWithMultiPrimaryKeys(t *testing.T) {
    	if name := DB.Dialector.Name(); name == "sqlite" || name == "sqlserver" {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
Back to top