tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.31k stars 905 forks source link

net/http/httptest not implemented #4526

Open dkegel-fastly opened 2 days ago

dkegel-fastly commented 2 days ago

The very first roadblock in testing libopenapi with tinygo is net/http/httptest not implemented. (Ditto for openapi-go.)

$ tinygo version
tinygo version 0.34.0-dev-d948941d darwin/amd64 (using go version go1.21.13 and LLVM version 18.1.2)
$ git clone git@github.com:pb33f/libopenapi.git
$ cd libopenapi
$ go test ./...
...
$ tinygo test ./...
../../go/pkg/mod/github.com/stretchr/testify@v1.9.0/assert/http_assertions.go:6:2: package net/http/httptest is not in std (/Users/dkegel/Library/Caches/tinygo/goroot-9951da0529238c9063c0f528b787a287b032b47730b2310d6d23558a64a022f9/src/net/http/httptest)
dgryski commented 6 hours ago

We probably need some hack in https://github.com/tinygo-org/tinygo/blob/release/loader/goroot.go to merge https://github.com/tinygo-org/net and https://github.com/golang/go/tree/master/src/net/http/httptest (and probably figure out what the strategy will be for the rest of the packages under net..)