Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestTransactionWithBlock (0.12 sec)

  1. tests/transaction_test.go

    		var result User
    		tx.First(&result, user.ID)
    		return nil
    	})
    
    	if err == nil {
    		t.Fatalf("Transaction should get error when using cancelled context")
    	}
    }
    
    func TestTransactionWithBlock(t *testing.T) {
    	assertPanic := func(f func()) {
    		defer func() {
    			if r := recover(); r == nil {
    				t.Fatalf("The code did not panic")
    			}
    		}()
    		f()
    	}
    
    	// rollback
    Registered: Sun Oct 27 09:35:08 UTC 2024
    - Last Modified: Sat Sep 14 12:58:29 UTC 2024
    - 12.9K bytes
    - Viewed (0)
Back to top