MCPcopy
hub / github.com/go-sql-driver/mysql / TestAtomicError

Function TestAtomicError

utils_test.go:211–231  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

209}
210
211func TestAtomicError(t *testing.T) {
212 var ae atomicError
213 if ae.Value() != nil {
214 t.Fatal("Expected value to be nil")
215 }
216
217 ae.Set(ErrMalformPkt)
218 if v := ae.Value(); v != ErrMalformPkt {
219 if v == nil {
220 t.Fatal("Value is still nil")
221 }
222 t.Fatal("Error did not match")
223 }
224 ae.Set(ErrPktSync)
225 if ae.Value() == ErrMalformPkt {
226 t.Fatal("Error still matches old error")
227 }
228 if v := ae.Value(); v != ErrPktSync {
229 t.Fatal("Error did not match")
230 }
231}
232
233func TestIsolationLevelMapping(t *testing.T) {
234 data := []struct {

Callers

nothing calls this directly

Calls 2

ValueMethod · 0.95
SetMethod · 0.95

Tested by

no test coverage detected