plugins/tests/crypto_test.go
2024-06-26 12:17:41 +08:00

23 lines
496 B
Go

package tests
import (
"apigo.cc/apigo/gojs"
_ "apigo.cc/apigo/plugins/crypto"
"os"
"path/filepath"
"strings"
"testing"
)
func TestCrypto(t *testing.T) {
if files, err := os.ReadDir("crypto_tests"); err == nil {
for _, f := range files {
if !f.IsDir() && strings.HasSuffix(f.Name(), "_test.js") {
testName := f.Name()[0 : len(f.Name())-8]
r, err := gojs.RunFile(filepath.Join("crypto_tests", f.Name()), nil)
Test(t, testName, r == true && err == nil, err)
}
}
}
}