github.com/gopherjs/gopherjs@v1.19.0-beta1.0.20240506212314-27071a8796e4/compiler/natives/src/math/math_test.go (about)

     1  //go:build js
     2  // +build js
     3  
     4  package math_test
     5  
     6  import (
     7  	"testing"
     8  )
     9  
    10  // Slightly higher tolerances than upstream, otherwise TestGamma fails.
    11  // TODO: Is there a better way to fix TestGamma? It's weird that only one test
    12  //
    13  //	requires increasing tolerances. Perhaps there's a better fix? Maybe we
    14  //	should override TestGamma specifically and not the package-wide tolerances,
    15  //	because this will cause many other tests to be less accurate. Or maybe this
    16  //	is fine?
    17  func close(a, b float64) bool     { return tolerance(a, b, 4e-14) }
    18  func veryclose(a, b float64) bool { return tolerance(a, b, 6e-15) }
    19  
    20  func testExp(t *testing.T, Exp func(float64) float64, name string) {
    21  	t.Skip("inaccurate")
    22  }