2024-02-18 13:23:11 +08:00
|
|
|
package tests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"apigo.cloud/git/apigo/gojs"
|
|
|
|
_ "apigo.cloud/git/apigo/plugins/crypto"
|
2024-03-24 12:28:02 +08:00
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
2024-02-18 13:23:11 +08:00
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2024-03-24 12:28:02 +08:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-02-18 13:23:11 +08:00
|
|
|
}
|