github.com/haraldrudell/parl@v0.4.176/pruntime/stack-trace_test.go (about)

     1  /*
     2  © 2022–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package pruntime
     7  
     8  import (
     9  	"testing"
    10  )
    11  
    12  func TestStackTrace(t *testing.T) {
    13  	// t.Fail()
    14  
    15  	// var s = "(" + string(StackTrace()) + ")"
    16  	// var s1 = strings.ReplaceAll(s, "\x20", "␠")
    17  	// s1 = strings.ReplaceAll(s1, "\t", "␉")
    18  
    19  	// // /opt/sw/parl/pruntime/stack-trace_test.go:17: stack trace:
    20  	// // (goroutine␠20␠[running]:
    21  	// // 	github.com/haraldrudell/parl/pruntime.StackTrace()
    22  	// // 	␉/opt/sw/parl/pruntime/stack-trace.go:26␠+0x50
    23  	// // 	github.com/haraldrudell/parl/pruntime.TestStackTrace(0x14000082ea0)
    24  	// // 	␉/opt/sw/parl/pruntime/stack-trace_test.go:16␠+0x28
    25  	// // 	testing.tRunner(0x14000082ea0,␠0x1022ec4c8)
    26  	// // 	␉/opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1595␠+0xe8
    27  	// // 	created␠by␠testing.(*T).Run␠in␠goroutine␠1
    28  	// // 	␉/opt/homebrew/Cellar/go/1.21.4/libexec/src/testing/testing.go:1648␠+0x33c
    29  	// // 	)
    30  	// t.Logf("stack trace:\n%s", s1)
    31  }