MCPcopy Create free account
hub / github.com/distributedio/titan / TestStringIncr

Function TestStringIncr

db/string_test.go:498–529  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

496}
497
498func TestStringIncr(t *testing.T) {
499 type args struct {
500 delta int64
501 }
502 tests := []struct {
503 name string
504 args args
505 want int64
506 }{
507 {
508 name: "Incr",
509 args: args{
510 delta: 10,
511 },
512 want: int64(20),
513 },
514 }
515 for _, tt := range tests {
516 t.Run(tt.name, func(t *testing.T) {
517 callFunc := func(txn *Transaction) {
518 s, err := GetString(txn, value)
519 assert.NoError(t, err)
520 err = s.Set([]byte("10"))
521 assert.NoError(t, err)
522 got, err := s.Incr(tt.args.delta)
523 assert.NoError(t, err)
524 assert.Equal(t, tt.want, got)
525 }
526 MockTest(t, callFunc)
527 })
528 }
529}
530
531func TestStringIncrf(t *testing.T) {
532 type args struct {

Callers

nothing calls this directly

Calls 4

GetStringFunction · 0.85
MockTestFunction · 0.85
IncrMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected