@voxgig/sdkgen 4.8.2 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/action/doctor.d.ts +1 -0
- package/dist/action/doctor.js +50 -2
- package/dist/action/doctor.js.map +1 -1
- package/dist/helpers/naming.js +4 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +21 -0
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/model/target/zig.aon +9 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/src/cmp/zig/Package_zig.ts +15 -11
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/EntityListOp.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +3 -3
- package/project/.sdk/src/cmp/zig/utility_zig.ts +50 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +208 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +150 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +442 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +714 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +902 -0
- package/project/.sdk/tm/go/test/omni/util.go +381 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +628 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +229 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +76 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +151 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +90 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +475 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +580 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +252 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/Makefile +15 -1
- package/project/.sdk/tm/zig/build.zig +23 -5
- package/project/.sdk/tm/zig/core/helpers.zig +52 -11
- package/project/.sdk/tm/zig/core/mem.zig +17 -1
- package/project/.sdk/tm/zig/core/utility.zig +23 -19
- package/project/.sdk/tm/zig/feature/audit.zig +2 -2
- package/project/.sdk/tm/zig/feature/cache.zig +2 -2
- package/project/.sdk/tm/zig/feature/debug.zig +5 -5
- package/project/.sdk/tm/zig/feature/netsim.zig +2 -2
- package/project/.sdk/tm/zig/feature/paging.zig +2 -2
- package/project/.sdk/tm/zig/feature/proxy.zig +15 -8
- package/project/.sdk/tm/zig/feature/streaming.zig +5 -5
- package/project/.sdk/tm/zig/feature/support.zig +3 -3
- package/project/.sdk/tm/zig/feature/telemetry.zig +5 -5
- package/project/.sdk/tm/zig/feature/test.zig +10 -5
- package/project/.sdk/tm/zig/test/fh.zig +10 -10
- package/project/.sdk/tm/zig/test/gotcha_test.zig +5 -5
- package/project/.sdk/tm/zig/test/omniresolver.zig +515 -0
- package/project/.sdk/tm/zig/test/omnismoke_test.zig +284 -0
- package/project/.sdk/tm/zig/test/pipeline_test.zig +8 -8
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +145 -155
- package/project/.sdk/tm/zig/test/struct_corpus.zig +264 -187
- package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +1314 -0
- package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +446 -0
- package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +7 -4
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +356 -157
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
- package/project/.sdk/tm/zig/test/struct_runner.zig +0 -464
|
@@ -1,1088 +0,0 @@
|
|
|
1
|
-
# Vendored struct corpus runner for the ProjectName SDK.
|
|
2
|
-
#
|
|
3
|
-
# Runs the shared JSON corpus (.sdk/test/test.json -> "struct") through the
|
|
4
|
-
# vendored Voxgig.Struct implementation. Mirrors the runner shipped with the
|
|
5
|
-
# struct port (fixJson / eqv / doMatch / matchval / runSet / runSingle).
|
|
6
|
-
# run/1 returns {npass, nfail, failures}.
|
|
7
|
-
|
|
8
|
-
defmodule ProjectName.StructCorpus do
|
|
9
|
-
alias Voxgig.Struct, as: S
|
|
10
|
-
alias Voxgig.Struct.Error, as: SE
|
|
11
|
-
alias ProjectName.Utility, as: U
|
|
12
|
-
|
|
13
|
-
@nullmark "__NULL__"
|
|
14
|
-
@undefmark "__UNDEF__"
|
|
15
|
-
@existsmark "__EXISTS__"
|
|
16
|
-
|
|
17
|
-
# --- minimal JSON parser -> heap nodes -----------------------------------
|
|
18
|
-
|
|
19
|
-
defp parse(str) do
|
|
20
|
-
{v, _rest} = parse_value(str)
|
|
21
|
-
v
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
defp skip_ws(<<c, rest::binary>>) when c in [?\s, ?\t, ?\n, ?\r], do: skip_ws(rest)
|
|
25
|
-
defp skip_ws(s), do: s
|
|
26
|
-
|
|
27
|
-
defp parse_value(s) do
|
|
28
|
-
s = skip_ws(s)
|
|
29
|
-
|
|
30
|
-
case s do
|
|
31
|
-
"{" <> rest -> parse_object(rest, [])
|
|
32
|
-
"[" <> rest -> parse_array(rest, [])
|
|
33
|
-
"\"" <> rest -> parse_string_raw(rest, [])
|
|
34
|
-
"true" <> rest -> {true, rest}
|
|
35
|
-
"false" <> rest -> {false, rest}
|
|
36
|
-
"null" <> rest -> {nil, rest}
|
|
37
|
-
_ -> parse_number(s)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
defp parse_object(s, acc) do
|
|
42
|
-
s = skip_ws(s)
|
|
43
|
-
|
|
44
|
-
case s do
|
|
45
|
-
"}" <> rest ->
|
|
46
|
-
pairs = acc |> Enum.reverse() |> Enum.flat_map(fn {k, v} -> [k, v] end)
|
|
47
|
-
{S.jm(pairs), rest}
|
|
48
|
-
|
|
49
|
-
_ ->
|
|
50
|
-
"\"" <> s1 = s
|
|
51
|
-
{key, s2} = parse_string_raw(s1, [])
|
|
52
|
-
s3 = skip_ws(s2)
|
|
53
|
-
":" <> s4 = s3
|
|
54
|
-
{val, s5} = parse_value(s4)
|
|
55
|
-
s6 = skip_ws(s5)
|
|
56
|
-
|
|
57
|
-
case s6 do
|
|
58
|
-
"," <> r -> parse_object(r, [{key, val} | acc])
|
|
59
|
-
"}" <> r -> parse_object("}" <> r, [{key, val} | acc])
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
defp parse_array(s, acc) do
|
|
65
|
-
s = skip_ws(s)
|
|
66
|
-
|
|
67
|
-
case s do
|
|
68
|
-
"]" <> rest ->
|
|
69
|
-
{S.jt(Enum.reverse(acc)), rest}
|
|
70
|
-
|
|
71
|
-
_ ->
|
|
72
|
-
{val, s1} = parse_value(s)
|
|
73
|
-
s2 = skip_ws(s1)
|
|
74
|
-
|
|
75
|
-
case s2 do
|
|
76
|
-
"," <> r -> parse_array(r, [val | acc])
|
|
77
|
-
"]" <> r -> parse_array("]" <> r, [val | acc])
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
defp parse_string_raw("\"" <> rest, acc), do: {IO.iodata_to_binary(Enum.reverse(acc)), rest}
|
|
83
|
-
|
|
84
|
-
defp parse_string_raw("\\" <> <<c, rest::binary>>, acc) do
|
|
85
|
-
case c do
|
|
86
|
-
?" -> parse_string_raw(rest, ["\"" | acc])
|
|
87
|
-
?\\ -> parse_string_raw(rest, ["\\" | acc])
|
|
88
|
-
?/ -> parse_string_raw(rest, ["/" | acc])
|
|
89
|
-
?n -> parse_string_raw(rest, ["\n" | acc])
|
|
90
|
-
?r -> parse_string_raw(rest, ["\r" | acc])
|
|
91
|
-
?t -> parse_string_raw(rest, ["\t" | acc])
|
|
92
|
-
?b -> parse_string_raw(rest, [<<8>> | acc])
|
|
93
|
-
?f -> parse_string_raw(rest, [<<12>> | acc])
|
|
94
|
-
?u ->
|
|
95
|
-
<<hex::binary-size(4), rest2::binary>> = rest
|
|
96
|
-
code = String.to_integer(hex, 16)
|
|
97
|
-
parse_string_raw(rest2, [<<code::utf8>> | acc])
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
defp parse_string_raw(<<c::utf8, rest::binary>>, acc),
|
|
102
|
-
do: parse_string_raw(rest, [<<c::utf8>> | acc])
|
|
103
|
-
|
|
104
|
-
defp parse_number(s) do
|
|
105
|
-
{numstr, rest} = take_number(s, [])
|
|
106
|
-
n = IO.iodata_to_binary(Enum.reverse(numstr))
|
|
107
|
-
|
|
108
|
-
val =
|
|
109
|
-
if String.contains?(n, ".") or String.contains?(n, "e") or String.contains?(n, "E") do
|
|
110
|
-
{f, ""} = Float.parse(n)
|
|
111
|
-
f
|
|
112
|
-
else
|
|
113
|
-
String.to_integer(n)
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
{val, rest}
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
defp take_number(<<c, rest::binary>>, acc)
|
|
120
|
-
when c in ?0..?9 or c in [?-, ?+, ?., ?e, ?E],
|
|
121
|
-
do: take_number(rest, [<<c>> | acc])
|
|
122
|
-
|
|
123
|
-
defp take_number(s, acc), do: {acc, s}
|
|
124
|
-
|
|
125
|
-
# --- node helpers --------------------------------------------------------
|
|
126
|
-
|
|
127
|
-
defp velems(v) do
|
|
128
|
-
if S.islist(v) do
|
|
129
|
-
n = S.size(v)
|
|
130
|
-
if n == 0, do: [], else: Enum.map(0..(n - 1), fn i -> S.getelem(v, i) end)
|
|
131
|
-
else
|
|
132
|
-
[]
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
defp ehas(e, k), do: S.ismap(e) and Enum.member?(S.keysof(e), k)
|
|
137
|
-
defp eget(e, k), do: if(S.ismap(e), do: S.getprop(e, k), else: nil)
|
|
138
|
-
|
|
139
|
-
defp jss(v) do
|
|
140
|
-
cond do
|
|
141
|
-
v == nil -> "null"
|
|
142
|
-
is_binary(v) -> v
|
|
143
|
-
true -> S.stringify(v)
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
defp joinpath(path), do: velems(path) |> Enum.map(&jss/1) |> Enum.join(".")
|
|
148
|
-
|
|
149
|
-
# --- fixJson -------------------------------------------------------------
|
|
150
|
-
|
|
151
|
-
defp fixj(v, flag) do
|
|
152
|
-
cond do
|
|
153
|
-
v == nil ->
|
|
154
|
-
if flag, do: @nullmark, else: nil
|
|
155
|
-
|
|
156
|
-
S.ismap(v) ->
|
|
157
|
-
Enum.each(S.keysof(v), fn k -> S.setprop(v, k, fixj(S.getprop(v, k), flag)) end)
|
|
158
|
-
v
|
|
159
|
-
|
|
160
|
-
S.islist(v) ->
|
|
161
|
-
n = S.size(v)
|
|
162
|
-
if n > 0, do: Enum.each(0..(n - 1), fn i -> S.setprop(v, i, fixj(S.getelem(v, i), flag)) end)
|
|
163
|
-
v
|
|
164
|
-
|
|
165
|
-
true ->
|
|
166
|
-
v
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
# --- eqv / matchval / doMatch --------------------------------------------
|
|
171
|
-
|
|
172
|
-
defp eqv(a, b) do
|
|
173
|
-
cond do
|
|
174
|
-
a == nil and b == nil -> true
|
|
175
|
-
is_boolean(a) or is_boolean(b) -> a === b
|
|
176
|
-
is_number(a) and is_number(b) -> a == b
|
|
177
|
-
is_binary(a) and is_binary(b) -> a == b
|
|
178
|
-
S.islist(a) and S.islist(b) -> eqv_list(a, b)
|
|
179
|
-
S.ismap(a) and S.ismap(b) -> eqv_map(a, b)
|
|
180
|
-
true -> a === b
|
|
181
|
-
end
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
defp eqv_list(a, b) do
|
|
185
|
-
S.size(a) == S.size(b) and
|
|
186
|
-
Enum.all?(velems(a) |> Enum.zip(velems(b)), fn {x, y} -> eqv(x, y) end)
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
defp eqv_map(a, b) do
|
|
190
|
-
ka = S.keysof(a)
|
|
191
|
-
kb = S.keysof(b)
|
|
192
|
-
Enum.sort(ka) == Enum.sort(kb) and Enum.all?(ka, fn k -> eqv(S.getprop(a, k), S.getprop(b, k)) end)
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
defp matchval(check0, base) do
|
|
196
|
-
check = if check0 == @undefmark or check0 == @nullmark, do: nil, else: check0
|
|
197
|
-
|
|
198
|
-
cond do
|
|
199
|
-
eqv(check, base) ->
|
|
200
|
-
true
|
|
201
|
-
|
|
202
|
-
is_binary(check) ->
|
|
203
|
-
basestr = S.stringify(base)
|
|
204
|
-
|
|
205
|
-
if String.length(check) >= 2 and String.starts_with?(check, "/") and
|
|
206
|
-
String.ends_with?(check, "/") do
|
|
207
|
-
pat = String.slice(check, 1, String.length(check) - 2)
|
|
208
|
-
Regex.match?(Regex.compile!(pat), basestr)
|
|
209
|
-
else
|
|
210
|
-
String.contains?(String.downcase(basestr), String.downcase(S.stringify(check)))
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
S.isfunc(check) ->
|
|
214
|
-
true
|
|
215
|
-
|
|
216
|
-
true ->
|
|
217
|
-
false
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
defp do_match(check, base0) do
|
|
222
|
-
base = S.clone(base0)
|
|
223
|
-
|
|
224
|
-
S.walk(check,
|
|
225
|
-
before: fn _k, v, _p, path ->
|
|
226
|
-
if not S.isnode(v) do
|
|
227
|
-
baseval = S.getpath(base, path)
|
|
228
|
-
|
|
229
|
-
cond do
|
|
230
|
-
eqv(baseval, v) -> :ok
|
|
231
|
-
v == @undefmark and baseval == nil -> :ok
|
|
232
|
-
v == @existsmark and baseval != nil -> :ok
|
|
233
|
-
not matchval(v, baseval) ->
|
|
234
|
-
raise SE,
|
|
235
|
-
message:
|
|
236
|
-
"MATCH: " <>
|
|
237
|
-
joinpath(path) <>
|
|
238
|
-
": [" <> S.stringify(v) <> "] <=> [" <> S.stringify(baseval) <> "]"
|
|
239
|
-
|
|
240
|
-
true -> :ok
|
|
241
|
-
end
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
v
|
|
245
|
-
end
|
|
246
|
-
)
|
|
247
|
-
end
|
|
248
|
-
|
|
249
|
-
# --- recording -----------------------------------------------------------
|
|
250
|
-
|
|
251
|
-
defp record(_group, _name, true, _msg), do: Process.put(:npass, Process.get(:npass, 0) + 1)
|
|
252
|
-
|
|
253
|
-
defp record(group, name, false, msg) do
|
|
254
|
-
Process.put(:nfail, Process.get(:nfail, 0) + 1)
|
|
255
|
-
Process.put(:failures, Process.get(:failures, []) ++ ["FAIL #{group} #{name} - #{msg}"])
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
defp errmsg(%SE{message: m}), do: m
|
|
259
|
-
defp errmsg(%{message: m}) when is_binary(m), do: m
|
|
260
|
-
defp errmsg(e), do: Exception.message(e)
|
|
261
|
-
|
|
262
|
-
# --- resolveArgs / checkResult / handleError -----------------------------
|
|
263
|
-
|
|
264
|
-
defp resolve_args(entry) do
|
|
265
|
-
cond do
|
|
266
|
-
ehas(entry, "ctx") -> [eget(entry, "ctx")]
|
|
267
|
-
ehas(entry, "args") ->
|
|
268
|
-
a = eget(entry, "args")
|
|
269
|
-
|
|
270
|
-
if S.islist(a) do
|
|
271
|
-
args = velems(a)
|
|
272
|
-
# ts's resolveArgs writes the live first arg back as entry.ctx, so a
|
|
273
|
-
# `match: {ctx: ...}` resolves for args-style entries too. Without it
|
|
274
|
-
# every such assertion reads null and asserts nothing.
|
|
275
|
-
case args do
|
|
276
|
-
[first | _] -> if S.ismap(first), do: S.setprop(entry, "ctx", first)
|
|
277
|
-
_ -> :ok
|
|
278
|
-
end
|
|
279
|
-
|
|
280
|
-
args
|
|
281
|
-
else
|
|
282
|
-
[]
|
|
283
|
-
end
|
|
284
|
-
ehas(entry, "in") -> [S.clone(eget(entry, "in"))]
|
|
285
|
-
true -> []
|
|
286
|
-
end
|
|
287
|
-
end
|
|
288
|
-
|
|
289
|
-
defp check_result(entry, args, res) do
|
|
290
|
-
matched =
|
|
291
|
-
if ehas(entry, "match") do
|
|
292
|
-
do_match(
|
|
293
|
-
eget(entry, "match"),
|
|
294
|
-
S.jm(["in", eget(entry, "in"), "args", S.jt(args), "out", eget(entry, "res"), "ctx", eget(entry, "ctx")])
|
|
295
|
-
)
|
|
296
|
-
|
|
297
|
-
true
|
|
298
|
-
else
|
|
299
|
-
false
|
|
300
|
-
end
|
|
301
|
-
|
|
302
|
-
out = eget(entry, "out")
|
|
303
|
-
|
|
304
|
-
cond do
|
|
305
|
-
eqv(out, res) -> :ok
|
|
306
|
-
matched and (out == @nullmark or out == nil) -> :ok
|
|
307
|
-
true -> raise SE, message: "Expected: #{S.stringify(out)}, got: #{S.stringify(res)}"
|
|
308
|
-
end
|
|
309
|
-
end
|
|
310
|
-
|
|
311
|
-
defp handle_error(entry, err) do
|
|
312
|
-
msg = errmsg(err)
|
|
313
|
-
|
|
314
|
-
if ehas(entry, "err") do
|
|
315
|
-
entry_err = eget(entry, "err")
|
|
316
|
-
|
|
317
|
-
if entry_err == true or matchval(entry_err, msg) do
|
|
318
|
-
if ehas(entry, "match") do
|
|
319
|
-
do_match(
|
|
320
|
-
eget(entry, "match"),
|
|
321
|
-
# ts hands do_match the ERROR OBJECT, so a corpus
|
|
322
|
-
# `match: {err: {message: ...}}` resolves; a bare string leaves
|
|
323
|
-
# err.message reading null.
|
|
324
|
-
S.jm([
|
|
325
|
-
"in", eget(entry, "in"), "out", eget(entry, "res"),
|
|
326
|
-
"ctx", eget(entry, "ctx"), "err", S.jm(["message", msg])
|
|
327
|
-
])
|
|
328
|
-
)
|
|
329
|
-
end
|
|
330
|
-
|
|
331
|
-
:ok
|
|
332
|
-
else
|
|
333
|
-
raise SE, message: "ERROR MATCH: [#{S.stringify(entry_err)}] <=> [#{msg}]"
|
|
334
|
-
end
|
|
335
|
-
else
|
|
336
|
-
raise err
|
|
337
|
-
end
|
|
338
|
-
end
|
|
339
|
-
|
|
340
|
-
# --- runSet / runSingle --------------------------------------------------
|
|
341
|
-
|
|
342
|
-
defp run_set(group, node, subject, flag_null \\ true) do
|
|
343
|
-
fixed = fixj(S.clone(node), flag_null)
|
|
344
|
-
testset = S.getprop(fixed, "set")
|
|
345
|
-
|
|
346
|
-
if S.islist(testset) do
|
|
347
|
-
Enum.each(velems(testset), fn entry ->
|
|
348
|
-
name = jss(eget(entry, "name"))
|
|
349
|
-
|
|
350
|
-
try do
|
|
351
|
-
if not ehas(entry, "out") and flag_null, do: S.setprop(entry, "out", @nullmark)
|
|
352
|
-
args = resolve_args(entry)
|
|
353
|
-
res = fixj(subject.(args), flag_null)
|
|
354
|
-
S.setprop(entry, "res", res)
|
|
355
|
-
check_result(entry, args, res)
|
|
356
|
-
record(group, name, true, "")
|
|
357
|
-
rescue
|
|
358
|
-
e ->
|
|
359
|
-
try do
|
|
360
|
-
handle_error(entry, e)
|
|
361
|
-
record(group, name, true, "")
|
|
362
|
-
rescue
|
|
363
|
-
e2 -> record(group, name, false, errmsg(e2))
|
|
364
|
-
end
|
|
365
|
-
end
|
|
366
|
-
end)
|
|
367
|
-
end
|
|
368
|
-
end
|
|
369
|
-
|
|
370
|
-
defp run_single(group, node, fun) do
|
|
371
|
-
try do
|
|
372
|
-
expected = eget(node, "out")
|
|
373
|
-
actual = fun.(eget(node, "in"))
|
|
374
|
-
|
|
375
|
-
if eqv(expected, actual) do
|
|
376
|
-
record(group, "single", true, "")
|
|
377
|
-
else
|
|
378
|
-
record(group, "single", false, "Expected: #{S.stringify(expected)}, got: #{S.stringify(actual)}")
|
|
379
|
-
end
|
|
380
|
-
rescue
|
|
381
|
-
e -> record(group, "single", false, errmsg(e))
|
|
382
|
-
end
|
|
383
|
-
end
|
|
384
|
-
|
|
385
|
-
# --- subject helpers -----------------------------------------------------
|
|
386
|
-
|
|
387
|
-
defp arg1(f), do: fn args -> f.(if(args == [], do: nil, else: hd(args))) end
|
|
388
|
-
defp vget(vin, k), do: if(S.ismap(vin), do: S.getprop(vin, k), else: nil)
|
|
389
|
-
defp vhas(vin, k), do: S.ismap(vin) and Enum.member?(S.keysof(vin), k)
|
|
390
|
-
|
|
391
|
-
defp grow_list(c, i) do
|
|
392
|
-
if S.size(c) <= i do
|
|
393
|
-
S.setprop(c, S.size(c), nil)
|
|
394
|
-
grow_list(c, i)
|
|
395
|
-
end
|
|
396
|
-
end
|
|
397
|
-
|
|
398
|
-
defp null_modifier(v, key, parent, _inj) do
|
|
399
|
-
cond do
|
|
400
|
-
v == @nullmark -> S.setprop(parent, key, nil)
|
|
401
|
-
is_binary(v) -> S.setprop(parent, key, String.replace(v, @nullmark, "null"))
|
|
402
|
-
true -> :ok
|
|
403
|
-
end
|
|
404
|
-
end
|
|
405
|
-
|
|
406
|
-
defp walk_copy_subject(vin) do
|
|
407
|
-
cur = S.jt([nil])
|
|
408
|
-
|
|
409
|
-
walkcopy = fn key, v, _parent, path ->
|
|
410
|
-
if key == nil do
|
|
411
|
-
inner = S.jt([cond do; S.ismap(v) -> S.jm([]); S.islist(v) -> S.jt([]); true -> v end])
|
|
412
|
-
S.setprop(cur, 0, inner)
|
|
413
|
-
else
|
|
414
|
-
i = S.size(path)
|
|
415
|
-
|
|
416
|
-
nv =
|
|
417
|
-
if S.isnode(v) do
|
|
418
|
-
c = S.getelem(cur, 0)
|
|
419
|
-
grow_list(c, i)
|
|
420
|
-
nvx = if S.ismap(v), do: S.jm([]), else: S.jt([])
|
|
421
|
-
S.setprop(c, i, nvx)
|
|
422
|
-
nvx
|
|
423
|
-
else
|
|
424
|
-
v
|
|
425
|
-
end
|
|
426
|
-
|
|
427
|
-
S.setprop(S.getelem(S.getelem(cur, 0), i - 1), key, nv)
|
|
428
|
-
end
|
|
429
|
-
|
|
430
|
-
v
|
|
431
|
-
end
|
|
432
|
-
|
|
433
|
-
S.walk(vin, before: walkcopy)
|
|
434
|
-
S.getelem(S.getelem(cur, 0), 0)
|
|
435
|
-
end
|
|
436
|
-
|
|
437
|
-
defp walk_depth_subject(vin) do
|
|
438
|
-
state = S.jm(["top", nil, "cur", nil])
|
|
439
|
-
|
|
440
|
-
copy = fn key, v, _parent, _path ->
|
|
441
|
-
if key == nil or S.isnode(v) do
|
|
442
|
-
child = if S.islist(v), do: S.jt([]), else: S.jm([])
|
|
443
|
-
|
|
444
|
-
if key == nil do
|
|
445
|
-
S.setprop(state, "top", child)
|
|
446
|
-
S.setprop(state, "cur", child)
|
|
447
|
-
else
|
|
448
|
-
S.setprop(S.getprop(state, "cur"), key, child)
|
|
449
|
-
S.setprop(state, "cur", child)
|
|
450
|
-
end
|
|
451
|
-
else
|
|
452
|
-
S.setprop(S.getprop(state, "cur"), key, v)
|
|
453
|
-
end
|
|
454
|
-
|
|
455
|
-
v
|
|
456
|
-
end
|
|
457
|
-
|
|
458
|
-
S.walk(vget(vin, "src"), before: copy, maxdepth: vget(vin, "maxdepth"))
|
|
459
|
-
S.getprop(state, "top")
|
|
460
|
-
end
|
|
461
|
-
|
|
462
|
-
defp run_walk_log(group, node) do
|
|
463
|
-
try do
|
|
464
|
-
test_data = S.clone(node)
|
|
465
|
-
log = S.jt([])
|
|
466
|
-
|
|
467
|
-
walklog = fn key, v, parent, path ->
|
|
468
|
-
S.setprop(
|
|
469
|
-
log,
|
|
470
|
-
S.size(log),
|
|
471
|
-
"k=" <>
|
|
472
|
-
(if key == nil, do: S.stringify(), else: S.stringify(key)) <>
|
|
473
|
-
", v=" <>
|
|
474
|
-
S.stringify(v) <>
|
|
475
|
-
", p=" <>
|
|
476
|
-
(if parent == nil, do: S.stringify(), else: S.stringify(parent)) <>
|
|
477
|
-
", t=" <>
|
|
478
|
-
S.pathify(path)
|
|
479
|
-
)
|
|
480
|
-
|
|
481
|
-
v
|
|
482
|
-
end
|
|
483
|
-
|
|
484
|
-
S.walk(S.getprop(test_data, "in"), after: walklog)
|
|
485
|
-
expected = S.getprop(S.getprop(test_data, "out"), "after")
|
|
486
|
-
|
|
487
|
-
if eqv(expected, log) do
|
|
488
|
-
record(group, "log", true, "")
|
|
489
|
-
else
|
|
490
|
-
record(group, "log", false, "Expected: #{S.stringify(expected)}, got: #{S.stringify(log)}")
|
|
491
|
-
end
|
|
492
|
-
rescue
|
|
493
|
-
e -> record(group, "log", false, errmsg(e))
|
|
494
|
-
end
|
|
495
|
-
end
|
|
496
|
-
|
|
497
|
-
# --- runAll --------------------------------------------------------------
|
|
498
|
-
|
|
499
|
-
defp run_all(spec) do
|
|
500
|
-
g = fn k -> S.getprop(spec, k) end
|
|
501
|
-
minor = g.("minor")
|
|
502
|
-
walks = g.("walk")
|
|
503
|
-
merges = g.("merge")
|
|
504
|
-
getpaths = g.("getpath")
|
|
505
|
-
injects = g.("inject")
|
|
506
|
-
transforms = g.("transform")
|
|
507
|
-
validates = g.("validate")
|
|
508
|
-
selects = g.("select")
|
|
509
|
-
sentinels = g.("sentinels")
|
|
510
|
-
mg = fn n -> S.getprop(minor, n) end
|
|
511
|
-
|
|
512
|
-
run_set("minor.isnode", mg.("isnode"), arg1(fn v -> S.isnode(v) end))
|
|
513
|
-
run_set("minor.ismap", mg.("ismap"), arg1(fn v -> S.ismap(v) end))
|
|
514
|
-
run_set("minor.islist", mg.("islist"), arg1(fn v -> S.islist(v) end))
|
|
515
|
-
run_set("minor.iskey", mg.("iskey"), arg1(fn v -> S.iskey(v) end), false)
|
|
516
|
-
run_set("minor.strkey", mg.("strkey"), arg1(fn v -> S.strkey(v) end), false)
|
|
517
|
-
run_set("minor.isempty", mg.("isempty"), arg1(fn v -> S.isempty(v) end), false)
|
|
518
|
-
run_set("minor.isfunc", mg.("isfunc"), arg1(fn v -> S.isfunc(v) end))
|
|
519
|
-
run_set("minor.clone", mg.("clone"), arg1(fn v -> S.clone(v) end), false)
|
|
520
|
-
run_set("minor.escre", mg.("escre"), arg1(fn v -> S.escre(v) end))
|
|
521
|
-
run_set("minor.escurl", mg.("escurl"), arg1(fn v -> S.escurl(v) end))
|
|
522
|
-
|
|
523
|
-
run_set(
|
|
524
|
-
"minor.stringify",
|
|
525
|
-
mg.("stringify"),
|
|
526
|
-
arg1(fn vin ->
|
|
527
|
-
if vhas(vin, "val"), do: S.stringify(vget(vin, "val"), vget(vin, "max")), else: S.stringify()
|
|
528
|
-
end),
|
|
529
|
-
false
|
|
530
|
-
)
|
|
531
|
-
|
|
532
|
-
run_set("minor.jsonify", mg.("jsonify"), arg1(fn vin -> S.jsonify(vget(vin, "val"), vget(vin, "flags")) end), false)
|
|
533
|
-
|
|
534
|
-
run_set(
|
|
535
|
-
"minor.getelem",
|
|
536
|
-
mg.("getelem"),
|
|
537
|
-
arg1(fn vin ->
|
|
538
|
-
alt = vget(vin, "alt")
|
|
539
|
-
if alt == nil, do: S.getelem(vget(vin, "val"), vget(vin, "key")), else: S.getelem(vget(vin, "val"), vget(vin, "key"), alt)
|
|
540
|
-
end),
|
|
541
|
-
false
|
|
542
|
-
)
|
|
543
|
-
|
|
544
|
-
run_set("minor.delprop", mg.("delprop"), arg1(fn vin -> S.delprop(vget(vin, "parent"), vget(vin, "key")) end))
|
|
545
|
-
run_set("minor.size", mg.("size"), arg1(fn v -> S.size(v) end), false)
|
|
546
|
-
run_set("minor.slice", mg.("slice"), arg1(fn vin -> S.slice(vget(vin, "val"), vget(vin, "start"), vget(vin, "end")) end), false)
|
|
547
|
-
run_set("minor.pad", mg.("pad"), arg1(fn vin -> S.pad(vget(vin, "val"), vget(vin, "pad"), vget(vin, "char")) end), false)
|
|
548
|
-
|
|
549
|
-
run_set(
|
|
550
|
-
"minor.pathify",
|
|
551
|
-
mg.("pathify"),
|
|
552
|
-
arg1(fn vin ->
|
|
553
|
-
if vhas(vin, "path"), do: S.pathify(vget(vin, "path"), vget(vin, "from")), else: S.pathify(S.noarg(), vget(vin, "from"))
|
|
554
|
-
end),
|
|
555
|
-
false
|
|
556
|
-
)
|
|
557
|
-
|
|
558
|
-
run_set("minor.items", mg.("items"), arg1(fn v -> S.items(v) end))
|
|
559
|
-
|
|
560
|
-
run_set(
|
|
561
|
-
"minor.getprop",
|
|
562
|
-
mg.("getprop"),
|
|
563
|
-
arg1(fn vin ->
|
|
564
|
-
alt = vget(vin, "alt")
|
|
565
|
-
if alt == nil, do: S.getprop(vget(vin, "val"), vget(vin, "key")), else: S.getprop(vget(vin, "val"), vget(vin, "key"), alt)
|
|
566
|
-
end),
|
|
567
|
-
false
|
|
568
|
-
)
|
|
569
|
-
|
|
570
|
-
run_set("minor.setprop", mg.("setprop"), arg1(fn vin -> S.setprop(vget(vin, "parent"), vget(vin, "key"), vget(vin, "val")) end))
|
|
571
|
-
run_set("minor.haskey", mg.("haskey"), arg1(fn vin -> S.haskey(vget(vin, "src"), vget(vin, "key")) end), false)
|
|
572
|
-
run_set("minor.keysof", mg.("keysof"), arg1(fn v -> S.keysof(v) |> S.jt() end))
|
|
573
|
-
run_set("minor.join", mg.("join"), arg1(fn vin -> S.join(vget(vin, "val"), vget(vin, "sep"), vget(vin, "url")) end), false)
|
|
574
|
-
run_set("minor.typify", mg.("typify"), fn args -> S.typify(if(args == [], do: S.noarg(), else: hd(args))) end, false)
|
|
575
|
-
run_set("minor.setpath", mg.("setpath"), arg1(fn vin -> S.setpath(vget(vin, "store"), vget(vin, "path"), vget(vin, "val")) end), false)
|
|
576
|
-
|
|
577
|
-
run_set("minor.filter", mg.("filter"), arg1(fn vin ->
|
|
578
|
-
c = vget(vin, "check")
|
|
579
|
-
|
|
580
|
-
check =
|
|
581
|
-
case c do
|
|
582
|
-
"gt3" -> fn {_k, x} -> is_number(x) and not is_boolean(x) and x > 3 end
|
|
583
|
-
"lt3" -> fn {_k, x} -> is_number(x) and not is_boolean(x) and x < 3 end
|
|
584
|
-
_ -> fn _ -> false end
|
|
585
|
-
end
|
|
586
|
-
|
|
587
|
-
S.filter(vget(vin, "val"), check)
|
|
588
|
-
end))
|
|
589
|
-
|
|
590
|
-
run_set("minor.typename", mg.("typename"), arg1(fn v -> S.typename(if(is_number(v) and not is_boolean(v), do: trunc(v), else: 0)) end))
|
|
591
|
-
|
|
592
|
-
run_set("minor.flatten", mg.("flatten"), arg1(fn vin ->
|
|
593
|
-
d = vget(vin, "depth")
|
|
594
|
-
S.flatten(vget(vin, "val"), if(is_number(d), do: trunc(d), else: 1))
|
|
595
|
-
end))
|
|
596
|
-
|
|
597
|
-
run_walk_log("walk.log", S.getprop(walks, "log"))
|
|
598
|
-
|
|
599
|
-
run_set("walk.basic", S.getprop(walks, "basic"), arg1(fn vin ->
|
|
600
|
-
S.walk(vin, after: fn _k, v, _p, path ->
|
|
601
|
-
if is_binary(v), do: v <> "~" <> joinpath(path), else: v
|
|
602
|
-
end)
|
|
603
|
-
end))
|
|
604
|
-
|
|
605
|
-
run_set("walk.copy", S.getprop(walks, "copy"), arg1(&walk_copy_subject/1))
|
|
606
|
-
run_set("walk.depth", S.getprop(walks, "depth"), arg1(&walk_depth_subject/1), false)
|
|
607
|
-
|
|
608
|
-
run_single("merge.basic", S.getprop(merges, "basic"), fn in_ -> S.merge(S.clone(in_)) end)
|
|
609
|
-
run_set("merge.cases", S.getprop(merges, "cases"), arg1(fn v -> S.merge(v) end))
|
|
610
|
-
run_set("merge.array", S.getprop(merges, "array"), arg1(fn v -> S.merge(v) end))
|
|
611
|
-
run_set("merge.integrity", S.getprop(merges, "integrity"), arg1(fn v -> S.merge(v) end))
|
|
612
|
-
run_set("merge.depth", S.getprop(merges, "depth"), arg1(fn vin -> S.merge(vget(vin, "val"), vget(vin, "depth")) end))
|
|
613
|
-
|
|
614
|
-
run_set("getpath.basic", S.getprop(getpaths, "basic"), arg1(fn vin -> S.getpath(vget(vin, "store"), vget(vin, "path")) end))
|
|
615
|
-
|
|
616
|
-
run_set("getpath.relative", S.getprop(getpaths, "relative"), arg1(fn vin ->
|
|
617
|
-
dp = vget(vin, "dpath")
|
|
618
|
-
dpath = if is_binary(dp), do: S.jt(String.split(dp, ".")), else: nil
|
|
619
|
-
injdef = S.jm(["dparent", vget(vin, "dparent"), "dpath", dpath])
|
|
620
|
-
S.getpath(vget(vin, "store"), vget(vin, "path"), injdef)
|
|
621
|
-
end))
|
|
622
|
-
|
|
623
|
-
run_set("getpath.special", S.getprop(getpaths, "special"), arg1(fn vin ->
|
|
624
|
-
S.getpath(vget(vin, "store"), vget(vin, "path"), vget(vin, "inj"))
|
|
625
|
-
end))
|
|
626
|
-
|
|
627
|
-
run_set("getpath.handler", S.getprop(getpaths, "handler"), arg1(fn vin ->
|
|
628
|
-
store = S.jm(["$TOP", vget(vin, "store"), "$FOO", fn -> "foo" end])
|
|
629
|
-
handler = fn _inj, val, _ref, _st -> if S.isfunc(val), do: val.(), else: val end
|
|
630
|
-
S.getpath(store, vget(vin, "path"), S.jm(["handler", handler]))
|
|
631
|
-
end))
|
|
632
|
-
|
|
633
|
-
run_single("inject.basic", S.getprop(injects, "basic"), fn in_ ->
|
|
634
|
-
S.inject(S.clone(S.getprop(in_, "val")), S.clone(S.getprop(in_, "store")))
|
|
635
|
-
end)
|
|
636
|
-
|
|
637
|
-
run_set("inject.string", S.getprop(injects, "string"), arg1(fn vin ->
|
|
638
|
-
S.inject(vget(vin, "val"), vget(vin, "store"), S.jm(["modify", &null_modifier/4, "extra", vget(vin, "current")]))
|
|
639
|
-
end))
|
|
640
|
-
|
|
641
|
-
run_set("inject.deep", S.getprop(injects, "deep"), arg1(fn vin -> S.inject(vget(vin, "val"), vget(vin, "store")) end))
|
|
642
|
-
|
|
643
|
-
run_single("transform.basic", S.getprop(transforms, "basic"), fn in_ ->
|
|
644
|
-
S.transform(S.getprop(in_, "data"), S.getprop(in_, "spec"))
|
|
645
|
-
end)
|
|
646
|
-
|
|
647
|
-
Enum.each(["paths", "cmds", "each", "pack", "ref"], fn gn ->
|
|
648
|
-
run_set("transform.#{gn}", S.getprop(transforms, gn), arg1(fn vin -> S.transform(vget(vin, "data"), vget(vin, "spec")) end))
|
|
649
|
-
end)
|
|
650
|
-
|
|
651
|
-
run_set("transform.modify", S.getprop(transforms, "modify"), arg1(fn vin ->
|
|
652
|
-
modifier = fn v, key, parent, _inj ->
|
|
653
|
-
if is_binary(v) and key != nil and parent != nil, do: S.setprop(parent, key, "@" <> v)
|
|
654
|
-
end
|
|
655
|
-
|
|
656
|
-
S.transform(vget(vin, "data"), vget(vin, "spec"), S.jm(["modify", modifier, "extra", vget(vin, "store")]))
|
|
657
|
-
end))
|
|
658
|
-
|
|
659
|
-
run_set("transform.format", S.getprop(transforms, "format"), arg1(fn vin -> S.transform(vget(vin, "data"), vget(vin, "spec")) end), false)
|
|
660
|
-
run_set("transform.apply", S.getprop(transforms, "apply"), arg1(fn vin -> S.transform(vget(vin, "data"), vget(vin, "spec")) end))
|
|
661
|
-
|
|
662
|
-
run_set("validate.basic", S.getprop(validates, "basic"), arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec")) end), false)
|
|
663
|
-
|
|
664
|
-
Enum.each(["child", "one", "exact"], fn gn ->
|
|
665
|
-
run_set("validate.#{gn}", S.getprop(validates, gn), arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec")) end))
|
|
666
|
-
end)
|
|
667
|
-
|
|
668
|
-
run_set("validate.invalid", S.getprop(validates, "invalid"), arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec")) end), false)
|
|
669
|
-
run_set("validate.special", S.getprop(validates, "special"), arg1(fn vin -> S.validate(vget(vin, "data"), vget(vin, "spec"), vget(vin, "inj")) end))
|
|
670
|
-
|
|
671
|
-
Enum.each(["basic", "operators", "edge", "alts"], fn gn ->
|
|
672
|
-
run_set("select.#{gn}", S.getprop(selects, gn), arg1(fn vin -> S.select(vget(vin, "obj"), vget(vin, "query")) end))
|
|
673
|
-
end)
|
|
674
|
-
|
|
675
|
-
if sentinels != nil do
|
|
676
|
-
run_set("sentinels.getprop_unify", S.getprop(sentinels, "getprop_unify"), arg1(fn vin -> S.getprop(vget(vin, "val"), vget(vin, "key"), vget(vin, "alt")) end), false)
|
|
677
|
-
run_set("sentinels.getelem_absent", S.getprop(sentinels, "getelem_absent"), arg1(fn vin -> S.getelem(vget(vin, "val"), vget(vin, "key"), vget(vin, "alt")) end), false)
|
|
678
|
-
run_set("sentinels.haskey_unify", S.getprop(sentinels, "haskey_unify"), arg1(fn vin -> S.haskey(vget(vin, "val"), vget(vin, "key")) end), false)
|
|
679
|
-
run_set("sentinels.isempty_unify", S.getprop(sentinels, "isempty_unify"), arg1(fn v -> S.isempty(v) end), false)
|
|
680
|
-
run_set("sentinels.isnode_unify", S.getprop(sentinels, "isnode_unify"), arg1(fn v -> S.isnode(v) end), false)
|
|
681
|
-
run_set("sentinels.stringify_null", S.getprop(sentinels, "stringify_null"), arg1(fn vin -> S.stringify(vin) end), false)
|
|
682
|
-
end
|
|
683
|
-
end
|
|
684
|
-
|
|
685
|
-
# --- public entry --------------------------------------------------------
|
|
686
|
-
|
|
687
|
-
def run(testfile \\ nil) do
|
|
688
|
-
Process.put(:npass, 0)
|
|
689
|
-
Process.put(:nfail, 0)
|
|
690
|
-
Process.put(:failures, [])
|
|
691
|
-
|
|
692
|
-
testfile = testfile || Path.join(File.cwd!(), "../.sdk/test/test.json")
|
|
693
|
-
raw = File.read!(testfile)
|
|
694
|
-
alltests = parse(raw)
|
|
695
|
-
spec = S.getprop(alltests, "struct")
|
|
696
|
-
run_all(spec)
|
|
697
|
-
|
|
698
|
-
{Process.get(:npass, 0), Process.get(:nfail, 0), Process.get(:failures, [])}
|
|
699
|
-
end
|
|
700
|
-
|
|
701
|
-
# --- PRIMARY corpus ------------------------------------------------------
|
|
702
|
-
#
|
|
703
|
-
# Drives .sdk/test/test.json -> "primary", the same language-neutral corpus
|
|
704
|
-
# the ts/js/lua/lean suites execute, through THIS SDK's request-shaping
|
|
705
|
-
# utilities. Before this, elixir mirrored the corpus by hand, so its cases
|
|
706
|
-
# could drift from the reference without anything noticing.
|
|
707
|
-
#
|
|
708
|
-
# The harness below is run_set's, with one difference: the subject receives
|
|
709
|
-
# the ENTRY rather than resolved args, because the args-style sections have
|
|
710
|
-
# to publish the context they build back onto the entry — a `match: ctx:`
|
|
711
|
-
# assertion reads it from there.
|
|
712
|
-
|
|
713
|
-
# A struct VALUE is itself a 2-tuple — {:vmap, id}, {:vlist, id}, {:vinj, id}
|
|
714
|
-
# — so a bare `{res, err}` clause destructures a perfectly good map into
|
|
715
|
-
# res=:vmap, err=<heap id>, and the run then fails with the heap id as its
|
|
716
|
-
# error message. Match the value shapes first.
|
|
717
|
-
defp pnorm({:vmap, _} = v), do: {v, nil}
|
|
718
|
-
defp pnorm({:vlist, _} = v), do: {v, nil}
|
|
719
|
-
defp pnorm({:vinj, _} = v), do: {v, nil}
|
|
720
|
-
defp pnorm({res, err}), do: {res, err}
|
|
721
|
-
defp pnorm(res), do: {res, nil}
|
|
722
|
-
|
|
723
|
-
# A ctx for a ctx-style entry: the corpus supplies it, the client supplies
|
|
724
|
-
# what makes it live (utility dispatch, options, config).
|
|
725
|
-
defp pctx(entry, util, opts, config) do
|
|
726
|
-
ctxmap = if ehas(entry, "ctx") and S.ismap(eget(entry, "ctx")), do: eget(entry, "ctx"), else: S.jm([])
|
|
727
|
-
ctx = pbuild(ctxmap, util, opts, config)
|
|
728
|
-
S.setprop(entry, "ctx", ctx)
|
|
729
|
-
ctx
|
|
730
|
-
end
|
|
731
|
-
|
|
732
|
-
# A LIVE context from a corpus map. The corpus carries spec/result/response
|
|
733
|
-
# as plain JSON; the utilities read and MUTATE them through Spec/Result/
|
|
734
|
-
# Response, so a bare map leaves them with nothing to work on — every
|
|
735
|
-
# `match: ctx.result.*` assertion then reads null, and prepare_* returns
|
|
736
|
-
# nothing. Mirrors make_ctx_from_map in the lua/js reference drivers.
|
|
737
|
-
defp pbuild(ctxmap, util, opts, config) do
|
|
738
|
-
ctx = ProjectName.Context.new(ctxmap, nil)
|
|
739
|
-
S.setprop(ctx, "utility", util)
|
|
740
|
-
S.setprop(ctx, "config", config)
|
|
741
|
-
# THE CLIENT IS OPT-IN. Some utilities read their defaults off it —
|
|
742
|
-
# prepare_headers reads opts_map(ctx.client) — but the client holds the
|
|
743
|
-
# root ctx, which holds the client, so anything that WALKS a ctx carrying
|
|
744
|
-
# one never terminates: makeContext returns a ctx, and make_error raises an
|
|
745
|
-
# error whose `ctx:` field is the ctx. Both hung the run until ExUnit
|
|
746
|
-
# killed it. Only the sections that need client defaults ask for it.
|
|
747
|
-
if Process.get(:pwantclient) == true and Process.get(:pclient) != nil,
|
|
748
|
-
do: S.setprop(ctx, "client", Process.get(:pclient))
|
|
749
|
-
if S.getprop(ctx, "options") == nil, do: S.setprop(ctx, "options", opts)
|
|
750
|
-
|
|
751
|
-
specmap = S.getprop(ctxmap, "spec")
|
|
752
|
-
if S.ismap(specmap), do: S.setprop(ctx, "spec", ProjectName.Spec.new(specmap))
|
|
753
|
-
|
|
754
|
-
resmap = S.getprop(ctxmap, "result")
|
|
755
|
-
|
|
756
|
-
if S.ismap(resmap) do
|
|
757
|
-
result = ProjectName.Result.new(resmap)
|
|
758
|
-
errmap = S.getprop(resmap, "err")
|
|
759
|
-
|
|
760
|
-
if S.ismap(errmap) do
|
|
761
|
-
msg = jss(S.getprop(errmap, "message"))
|
|
762
|
-
if is_binary(msg) and msg != "",
|
|
763
|
-
do: S.setprop(result, "err", ProjectName.Error.new("", msg, nil))
|
|
764
|
-
end
|
|
765
|
-
|
|
766
|
-
S.setprop(ctx, "result", result)
|
|
767
|
-
end
|
|
768
|
-
|
|
769
|
-
respmap = S.getprop(ctxmap, "response")
|
|
770
|
-
|
|
771
|
-
if S.ismap(respmap) do
|
|
772
|
-
response = ProjectName.Response.new(respmap)
|
|
773
|
-
body = S.getprop(respmap, "body")
|
|
774
|
-
if body != nil, do: S.setprop(response, "json_func", fn -> body end)
|
|
775
|
-
|
|
776
|
-
hdrs = S.getprop(respmap, "headers")
|
|
777
|
-
|
|
778
|
-
if S.ismap(hdrs) do
|
|
779
|
-
lower = S.jm([])
|
|
780
|
-
Enum.each(S.keysof(hdrs), fn k ->
|
|
781
|
-
S.setprop(lower, String.downcase(k), S.getprop(hdrs, k))
|
|
782
|
-
end)
|
|
783
|
-
S.setprop(response, "headers", lower)
|
|
784
|
-
end
|
|
785
|
-
|
|
786
|
-
S.setprop(ctx, "response", response)
|
|
787
|
-
end
|
|
788
|
-
|
|
789
|
-
ctx
|
|
790
|
-
end
|
|
791
|
-
|
|
792
|
-
# A ctx from a bare map (args-style sections), published back onto the entry.
|
|
793
|
-
defp pmapctx(entry, v, util, opts, config) do
|
|
794
|
-
ctx = pbuild(if(S.ismap(v), do: v, else: S.jm([])), util, opts, config)
|
|
795
|
-
S.setprop(entry, "ctx", ctx)
|
|
796
|
-
ctx
|
|
797
|
-
end
|
|
798
|
-
|
|
799
|
-
# A ctx that carries the client, for the sections whose utilities read their
|
|
800
|
-
# defaults off it. Scoped so nothing else inherits the cycle.
|
|
801
|
-
defp pctx_client(entry, util, opts, config) do
|
|
802
|
-
Process.put(:pwantclient, true)
|
|
803
|
-
ctx = pctx(entry, util, opts, config)
|
|
804
|
-
Process.put(:pwantclient, false)
|
|
805
|
-
ctx
|
|
806
|
-
end
|
|
807
|
-
|
|
808
|
-
defp parg(entry, i) do
|
|
809
|
-
a = eget(entry, "args")
|
|
810
|
-
if S.islist(a), do: Enum.at(velems(a), i), else: nil
|
|
811
|
-
end
|
|
812
|
-
|
|
813
|
-
defp run_primary_set(group, node, subject) do
|
|
814
|
-
if System.get_env("VOX_DBG"), do: IO.puts("SECTION #{group}")
|
|
815
|
-
fixed = fixj(S.clone(node), true)
|
|
816
|
-
testset = S.getprop(fixed, "set")
|
|
817
|
-
|
|
818
|
-
if S.islist(testset) do
|
|
819
|
-
Enum.each(velems(testset), fn entry ->
|
|
820
|
-
name = jss(eget(entry, "name"))
|
|
821
|
-
|
|
822
|
-
try do
|
|
823
|
-
if not ehas(entry, "out"), do: S.setprop(entry, "out", @nullmark)
|
|
824
|
-
{res0, err} = pnorm(subject.(entry))
|
|
825
|
-
|
|
826
|
-
if err != nil do
|
|
827
|
-
raise SE, message: perrmsg(err)
|
|
828
|
-
end
|
|
829
|
-
|
|
830
|
-
# The RESULT can carry them too — makeContext returns a context — and
|
|
831
|
-
# fixj walks it before anything else gets the chance to strip.
|
|
832
|
-
if S.ismap(res0) do
|
|
833
|
-
S.delprop(res0, "client")
|
|
834
|
-
S.delprop(res0, "utility")
|
|
835
|
-
end
|
|
836
|
-
|
|
837
|
-
res = fixj(res0, true)
|
|
838
|
-
S.setprop(entry, "res", res)
|
|
839
|
-
|
|
840
|
-
# STRIP THE LIVE REFERENCES BEFORE MATCHING. check_result matches
|
|
841
|
-
# against entry.ctx, and the ctx carries the client so utilities like
|
|
842
|
-
# prepare_headers can read their defaults off it. The client holds the
|
|
843
|
-
# root ctx, which holds the client — walking that is a cycle, and the
|
|
844
|
-
# run hangs until ExUnit kills it at 60s. The utilities have already
|
|
845
|
-
# run by here, so nothing needs them any more.
|
|
846
|
-
ectx = eget(entry, "ctx")
|
|
847
|
-
|
|
848
|
-
if S.ismap(ectx) do
|
|
849
|
-
S.delprop(ectx, "client")
|
|
850
|
-
S.delprop(ectx, "utility")
|
|
851
|
-
end
|
|
852
|
-
|
|
853
|
-
check_result(entry, resolve_args(entry), res)
|
|
854
|
-
record(group, name, true, "")
|
|
855
|
-
rescue
|
|
856
|
-
e ->
|
|
857
|
-
try do
|
|
858
|
-
handle_error(entry, e)
|
|
859
|
-
record(group, name, true, "")
|
|
860
|
-
rescue
|
|
861
|
-
e2 -> record(group, name, false, errmsg(e2))
|
|
862
|
-
end
|
|
863
|
-
end
|
|
864
|
-
end)
|
|
865
|
-
end
|
|
866
|
-
end
|
|
867
|
-
|
|
868
|
-
# The corpus speaks camelCase; snake_case languages do not. lua, py and
|
|
869
|
-
# elixir all store `status_text` internally while reading `statusText` off
|
|
870
|
-
# the wire, so a `match: ctx.result.statusText` assertion reads null unless
|
|
871
|
-
# the driver publishes a neutral-named view back. The lua reference driver
|
|
872
|
-
# does exactly this.
|
|
873
|
-
defp pneutral_result(result) do
|
|
874
|
-
if S.ismap(result) do
|
|
875
|
-
err = S.getprop(result, "err")
|
|
876
|
-
|
|
877
|
-
S.jm([
|
|
878
|
-
"ok", S.getprop(result, "ok"),
|
|
879
|
-
"status", S.getprop(result, "status"),
|
|
880
|
-
"statusText", S.getprop(result, "status_text"),
|
|
881
|
-
"headers", S.getprop(result, "headers"),
|
|
882
|
-
"body", S.getprop(result, "body"),
|
|
883
|
-
"err", if(err == nil, do: nil, else: S.jm(["message", perrmsg(err)]))
|
|
884
|
-
])
|
|
885
|
-
end
|
|
886
|
-
end
|
|
887
|
-
|
|
888
|
-
# Publish the neutral view of ctx.result onto the entry's ctx, so
|
|
889
|
-
# `match: ctx.result.*` sees corpus-shaped data.
|
|
890
|
-
defp ppub(entry, ctx) do
|
|
891
|
-
ectx = eget(entry, "ctx")
|
|
892
|
-
result = if S.ismap(ctx), do: S.getprop(ctx, "result")
|
|
893
|
-
if S.ismap(ectx) and S.ismap(result) do
|
|
894
|
-
S.setprop(ectx, "result", pneutral_result(result))
|
|
895
|
-
end
|
|
896
|
-
:ok
|
|
897
|
-
end
|
|
898
|
-
|
|
899
|
-
defp perrmsg(err) do
|
|
900
|
-
cond do
|
|
901
|
-
is_binary(err) -> err
|
|
902
|
-
S.ismap(err) -> jss(S.getprop(err, "message")) || S.stringify(err)
|
|
903
|
-
true -> inspect(err)
|
|
904
|
-
end
|
|
905
|
-
end
|
|
906
|
-
|
|
907
|
-
defp psec(primary, name, sub \\ "basic"), do: S.getprop(S.getprop(primary, name), sub)
|
|
908
|
-
|
|
909
|
-
# A CLIENT built from a section's DEF.setup.a block.
|
|
910
|
-
#
|
|
911
|
-
# prepare_auth reads opts_map(ctx.client) — as the ts reference does, via
|
|
912
|
-
# client.options() — so a section's setup options have to reach it through a
|
|
913
|
-
# client, not through ctx.options. Passing them as options alone left the
|
|
914
|
-
# apikey unreachable and the authorization header never set.
|
|
915
|
-
defp pclient_for(primary, name) do
|
|
916
|
-
setup = S.getprop(S.getprop(S.getprop(S.getprop(primary, name), "DEF"), "setup"), "a")
|
|
917
|
-
if S.ismap(setup), do: ProjectName.test(nil, S.clone(setup)), else: ProjectName.test()
|
|
918
|
-
end
|
|
919
|
-
|
|
920
|
-
# Options built from a section's DEF.setup.a block, the way the reference
|
|
921
|
-
# harness does. Falls back to the client's options when a section has none.
|
|
922
|
-
defp psetup(primary, name, util, config) do
|
|
923
|
-
setup =
|
|
924
|
-
S.getprop(S.getprop(S.getprop(S.getprop(primary, name), "DEF"), "setup"), "a")
|
|
925
|
-
|
|
926
|
-
ctx = S.jm([])
|
|
927
|
-
S.setprop(ctx, "utility", util)
|
|
928
|
-
S.setprop(ctx, "config", config)
|
|
929
|
-
S.setprop(ctx, "options", if(S.ismap(setup), do: S.clone(setup), else: S.jm([])))
|
|
930
|
-
U.make_options(ctx)
|
|
931
|
-
end
|
|
932
|
-
|
|
933
|
-
def run_primary(testfile \\ nil) do
|
|
934
|
-
Process.put(:npass, 0)
|
|
935
|
-
Process.put(:nfail, 0)
|
|
936
|
-
Process.put(:failures, [])
|
|
937
|
-
|
|
938
|
-
testfile = testfile || Path.join(File.cwd!(), "../.sdk/test/test.json")
|
|
939
|
-
root = parse(File.read!(testfile))
|
|
940
|
-
primary = S.getprop(root, "primary")
|
|
941
|
-
|
|
942
|
-
client = ProjectName.test()
|
|
943
|
-
Process.put(:pclient, client)
|
|
944
|
-
Process.put(:pbaseclient, client)
|
|
945
|
-
rootctx = ProjectName.get_root_ctx(client)
|
|
946
|
-
util = S.getprop(rootctx, "utility")
|
|
947
|
-
config = S.getprop(rootctx, "config")
|
|
948
|
-
opts = S.getprop(rootctx, "options")
|
|
949
|
-
|
|
950
|
-
run_primary_set("done", psec(primary, "done"), fn e ->
|
|
951
|
-
U.done(pctx(e, util, opts, config))
|
|
952
|
-
end)
|
|
953
|
-
|
|
954
|
-
# makeContext takes a PLAIN map and returns a context; it needs no client
|
|
955
|
-
# and no utility dispatch. Handing it a live ctx made Context.new copy the
|
|
956
|
-
# client through, and fixj then walked client -> rootctx -> client.
|
|
957
|
-
run_primary_set("makeContext", psec(primary, "makeContext"), fn e ->
|
|
958
|
-
inv = eget(e, "in")
|
|
959
|
-
ctxmap = if S.ismap(inv), do: inv, else: S.jm([])
|
|
960
|
-
S.setprop(e, "ctx", ctxmap)
|
|
961
|
-
ProjectName.Context.new(ctxmap, nil)
|
|
962
|
-
end)
|
|
963
|
-
|
|
964
|
-
run_primary_set("makeError", psec(primary, "makeError"), fn e ->
|
|
965
|
-
ctx = pmapctx(e, parg(e, 0), util, opts, config)
|
|
966
|
-
{nil, U.make_error(ctx, parg(e, 1))}
|
|
967
|
-
end)
|
|
968
|
-
|
|
969
|
-
run_primary_set("makeOptions", psec(primary, "makeOptions"), fn e ->
|
|
970
|
-
inv = eget(e, "in")
|
|
971
|
-
ctx = pmapctx(e, S.jm([]), util, opts, config)
|
|
972
|
-
S.setprop(ctx, "config", S.getprop(inv, "config"))
|
|
973
|
-
S.setprop(ctx, "options", S.getprop(inv, "options"))
|
|
974
|
-
U.make_options(ctx)
|
|
975
|
-
end)
|
|
976
|
-
|
|
977
|
-
run_primary_set("makeRequest", psec(primary, "makeRequest"), fn e ->
|
|
978
|
-
U.make_request(pctx(e, util, opts, config))
|
|
979
|
-
end)
|
|
980
|
-
|
|
981
|
-
run_primary_set("makeResponse", psec(primary, "makeResponse"), fn e ->
|
|
982
|
-
ctx = pctx(e, util, opts, config)
|
|
983
|
-
out = U.make_response(ctx)
|
|
984
|
-
ppub(e, ctx)
|
|
985
|
-
out
|
|
986
|
-
end)
|
|
987
|
-
|
|
988
|
-
# makeSpec and prepareAuth are configured by their own DEF.setup.a block,
|
|
989
|
-
# not by the client's default options — the corpus supplies the base URL
|
|
990
|
-
# and the api key the cases assert on.
|
|
991
|
-
spec_opts = psetup(primary, "makeSpec", util, config)
|
|
992
|
-
|
|
993
|
-
run_primary_set("makeSpec", psec(primary, "makeSpec"), fn e ->
|
|
994
|
-
U.make_spec(pctx_client(e, util, spec_opts, config))
|
|
995
|
-
end)
|
|
996
|
-
|
|
997
|
-
run_primary_set("makeUrl", psec(primary, "makeUrl"), fn e ->
|
|
998
|
-
U.make_url(pctx(e, util, opts, config))
|
|
999
|
-
end)
|
|
1000
|
-
|
|
1001
|
-
run_primary_set("operator", psec(primary, "operator"), fn e ->
|
|
1002
|
-
inv = eget(e, "in")
|
|
1003
|
-
op = ProjectName.Operation.new(if(S.ismap(inv), do: inv, else: S.jm([])))
|
|
1004
|
-
S.jm([
|
|
1005
|
-
"entity", S.getprop(op, "entity"),
|
|
1006
|
-
"input", S.getprop(op, "input"),
|
|
1007
|
-
"name", S.getprop(op, "name"),
|
|
1008
|
-
"points", S.getprop(op, "points")
|
|
1009
|
-
])
|
|
1010
|
-
end)
|
|
1011
|
-
|
|
1012
|
-
run_primary_set("param", psec(primary, "param"), fn e ->
|
|
1013
|
-
ctx = pmapctx(e, parg(e, 0), util, opts, config)
|
|
1014
|
-
U.param(ctx, parg(e, 1))
|
|
1015
|
-
end)
|
|
1016
|
-
|
|
1017
|
-
auth_opts = psetup(primary, "prepareAuth", util, config)
|
|
1018
|
-
auth_client = pclient_for(primary, "prepareAuth")
|
|
1019
|
-
|
|
1020
|
-
run_primary_set("prepareAuth", psec(primary, "prepareAuth"), fn e ->
|
|
1021
|
-
Process.put(:pclient, auth_client)
|
|
1022
|
-
out = U.prepare_auth(pctx_client(e, util, auth_opts, config))
|
|
1023
|
-
Process.put(:pclient, Process.get(:pbaseclient))
|
|
1024
|
-
out
|
|
1025
|
-
end)
|
|
1026
|
-
|
|
1027
|
-
run_primary_set("prepareBody", psec(primary, "prepareBody"), fn e ->
|
|
1028
|
-
U.prepare_body(pctx(e, util, opts, config))
|
|
1029
|
-
end)
|
|
1030
|
-
|
|
1031
|
-
run_primary_set("prepareHeaders", psec(primary, "prepareHeaders"), fn e ->
|
|
1032
|
-
U.prepare_headers(pctx_client(e, util, opts, config))
|
|
1033
|
-
end)
|
|
1034
|
-
|
|
1035
|
-
run_primary_set("prepareMethod", psec(primary, "prepareMethod"), fn e ->
|
|
1036
|
-
U.prepare_method(pctx(e, util, opts, config))
|
|
1037
|
-
end)
|
|
1038
|
-
|
|
1039
|
-
run_primary_set("prepareParams", psec(primary, "prepareParams"), fn e ->
|
|
1040
|
-
U.prepare_params(pctx(e, util, opts, config))
|
|
1041
|
-
end)
|
|
1042
|
-
|
|
1043
|
-
run_primary_set("preparePath", psec(primary, "preparePath"), fn e ->
|
|
1044
|
-
U.prepare_path(pctx(e, util, opts, config))
|
|
1045
|
-
end)
|
|
1046
|
-
|
|
1047
|
-
run_primary_set("prepareQuery", psec(primary, "prepareQuery"), fn e ->
|
|
1048
|
-
U.prepare_query(pctx(e, util, opts, config))
|
|
1049
|
-
end)
|
|
1050
|
-
|
|
1051
|
-
run_primary_set("resultBasic", psec(primary, "resultBasic"), fn e ->
|
|
1052
|
-
ctx = pctx(e, util, opts, config)
|
|
1053
|
-
out = U.result_basic(ctx)
|
|
1054
|
-
ppub(e, ctx)
|
|
1055
|
-
if S.ismap(out) and S.getprop(out, "status_text") != nil,
|
|
1056
|
-
do: pneutral_result(out),
|
|
1057
|
-
else: out
|
|
1058
|
-
end)
|
|
1059
|
-
|
|
1060
|
-
run_primary_set("resultBody", psec(primary, "resultBody"), fn e ->
|
|
1061
|
-
ctx = pctx(e, util, opts, config)
|
|
1062
|
-
out = U.result_body(ctx)
|
|
1063
|
-
ppub(e, ctx)
|
|
1064
|
-
if S.ismap(out) and S.getprop(out, "status_text") != nil,
|
|
1065
|
-
do: pneutral_result(out),
|
|
1066
|
-
else: out
|
|
1067
|
-
end)
|
|
1068
|
-
|
|
1069
|
-
run_primary_set("resultHeaders", psec(primary, "resultHeaders"), fn e ->
|
|
1070
|
-
ctx = pctx(e, util, opts, config)
|
|
1071
|
-
out = U.result_headers(ctx)
|
|
1072
|
-
ppub(e, ctx)
|
|
1073
|
-
if S.ismap(out) and S.getprop(out, "status_text") != nil,
|
|
1074
|
-
do: pneutral_result(out),
|
|
1075
|
-
else: out
|
|
1076
|
-
end)
|
|
1077
|
-
|
|
1078
|
-
run_primary_set("transformRequest", psec(primary, "transformRequest"), fn e ->
|
|
1079
|
-
U.transform_request(pctx(e, util, opts, config))
|
|
1080
|
-
end)
|
|
1081
|
-
|
|
1082
|
-
run_primary_set("transformResponse", psec(primary, "transformResponse"), fn e ->
|
|
1083
|
-
U.transform_response(pctx(e, util, opts, config))
|
|
1084
|
-
end)
|
|
1085
|
-
|
|
1086
|
-
{Process.get(:npass, 0), Process.get(:nfail, 0), Process.get(:failures, [])}
|
|
1087
|
-
end
|
|
1088
|
-
end
|