Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardJES committed May 17, 2024
1 parent e84f8e6 commit ca2559c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions routine_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package relax

import (
"bytes"
"errors"
"log"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -100,6 +102,18 @@ func TestRoutine_Panic_NotNilError(t *testing.T) {
}
}

func TestRoutine_Stack_WritesStack(t *testing.T) {
var buf bytes.Buffer
log.SetOutput(&buf)
defer log.SetOutput(nil)

r := &Routine{
stackBuff: make([]byte, 1<<16),
}
stack := r.stack()
assert.NotEmpty(t, stack)
}

func TestRecoverError(t *testing.T) {
var tests = []struct {
name string
Expand Down

0 comments on commit ca2559c

Please sign in to comment.