@voxgig/sdkgen 4.8.2 → 4.8.3
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/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/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 +209 -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 +151 -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 +439 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -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 +897 -0
- package/project/.sdk/tm/go/test/omni/util.go +360 -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 +613 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -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 +74 -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 +152 -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 +92 -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 +455 -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 +566 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -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/test/primary_utility_test.zig +1 -1
- package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
- 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
|
@@ -1,340 +1,29 @@
|
|
|
1
|
-
/- Struct corpus
|
|
2
|
-
../.sdk/test/test.json
|
|
3
|
-
other
|
|
4
|
-
|
|
5
|
-
directly, so the Lean port is exercised exactly as in production. -/
|
|
1
|
+
/- Struct corpus: drives the `struct` subtree of the shared
|
|
2
|
+
../.sdk/test/test.json — the project's own compiled corpus, the same file
|
|
3
|
+
every other target reads — through the vendored voxgig/struct port, on the
|
|
4
|
+
vendored @voxgig/omni engine.
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-- ---------------- JSON reader -> Value ----------------
|
|
16
|
-
|
|
17
|
-
structure JState where
|
|
18
|
-
src : Array Char
|
|
19
|
-
pos : Nat
|
|
20
|
-
|
|
21
|
-
partial def jPeek (s : JState) : Option Char := s.src[s.pos]?
|
|
22
|
-
|
|
23
|
-
partial def jSkipWs (s : JState) : JState := Id.run do
|
|
24
|
-
let mut p := s.pos
|
|
25
|
-
while p < s.src.size &&
|
|
26
|
-
(s.src[p]! == ' ' || s.src[p]! == '\t' || s.src[p]! == '\n' || s.src[p]! == '\r') do
|
|
27
|
-
p := p + 1
|
|
28
|
-
return { s with pos := p }
|
|
29
|
-
|
|
30
|
-
partial def jStr (s0 : JState) : SIO (String × JState) := do
|
|
31
|
-
-- assumes current char is '"'
|
|
32
|
-
let src := s0.src
|
|
33
|
-
let mut p := s0.pos + 1
|
|
34
|
-
let mut b := ""
|
|
35
|
-
repeat do
|
|
36
|
-
if p >= src.size then break
|
|
37
|
-
let c := src[p]!
|
|
38
|
-
p := p + 1
|
|
39
|
-
if c == '"' then break
|
|
40
|
-
if c == '\\' then
|
|
41
|
-
let e := src[p]!
|
|
42
|
-
p := p + 1
|
|
43
|
-
match e with
|
|
44
|
-
| '"' => b := b.push '"'
|
|
45
|
-
| '\\' => b := b.push '\\'
|
|
46
|
-
| '/' => b := b.push '/'
|
|
47
|
-
| 'n' => b := b.push '\n'
|
|
48
|
-
| 't' => b := b.push '\t'
|
|
49
|
-
| 'r' => b := b.push '\r'
|
|
50
|
-
| 'b' => b := b.push '\x08'
|
|
51
|
-
| 'f' => b := b.push '\x0c'
|
|
52
|
-
| 'u' => do
|
|
53
|
-
let mut code : Nat := 0
|
|
54
|
-
for _ in [0:4] do
|
|
55
|
-
let h := src[p]!
|
|
56
|
-
p := p + 1
|
|
57
|
-
let d :=
|
|
58
|
-
if h >= '0' && h <= '9' then h.toNat - '0'.toNat
|
|
59
|
-
else if h >= 'a' && h <= 'f' then 10 + h.toNat - 'a'.toNat
|
|
60
|
-
else if h >= 'A' && h <= 'F' then 10 + h.toNat - 'A'.toNat
|
|
61
|
-
else 0
|
|
62
|
-
code := code * 16 + d
|
|
63
|
-
b := b.push (Char.ofNat code)
|
|
64
|
-
| c => b := b.push c
|
|
65
|
-
else
|
|
66
|
-
b := b.push c
|
|
67
|
-
return (b, { s0 with pos := p })
|
|
68
|
-
|
|
69
|
-
mutual
|
|
70
|
-
|
|
71
|
-
partial def jVal (s0 : JState) : SIO (Value × JState) := do
|
|
72
|
-
let s := jSkipWs s0
|
|
73
|
-
match jPeek s with
|
|
74
|
-
| some '{' => jObj s
|
|
75
|
-
| some '[' => jArr s
|
|
76
|
-
| some '"' => do
|
|
77
|
-
let (str, s') ← jStr s
|
|
78
|
-
pure (.str str, s')
|
|
79
|
-
| some 't' => pure (.bool true, { s with pos := s.pos + 4 })
|
|
80
|
-
| some 'f' => pure (.bool false, { s with pos := s.pos + 5 })
|
|
81
|
-
| some 'n' => pure (.null, { s with pos := s.pos + 4 })
|
|
82
|
-
| _ => jNum s
|
|
83
|
-
|
|
84
|
-
partial def jObj (s0 : JState) : SIO (Value × JState) := do
|
|
85
|
-
let s := jSkipWs { s0 with pos := s0.pos + 1 }
|
|
86
|
-
if jPeek s == some '}' then
|
|
87
|
-
pure (← emptyMap, { s with pos := s.pos + 1 })
|
|
88
|
-
else do
|
|
89
|
-
let m ← emptyMap
|
|
90
|
-
let sRef ← IO.mkRef s
|
|
91
|
-
repeat do
|
|
92
|
-
let s1 := jSkipWs (← sRef.get)
|
|
93
|
-
let (k, s2) ← jStr s1
|
|
94
|
-
let s3 := jSkipWs s2
|
|
95
|
-
let s4 := { s3 with pos := s3.pos + 1 } -- ':'
|
|
96
|
-
let (v, s5) ← jVal s4
|
|
97
|
-
let _ ← setprop m (.str k) v
|
|
98
|
-
let s6 := jSkipWs s5
|
|
99
|
-
let c := (jPeek s6).getD '}'
|
|
100
|
-
sRef.set { s6 with pos := s6.pos + 1 }
|
|
101
|
-
if c != ',' then break
|
|
102
|
-
pure (m, ← sRef.get)
|
|
103
|
-
|
|
104
|
-
partial def jArr (s0 : JState) : SIO (Value × JState) := do
|
|
105
|
-
let s := jSkipWs { s0 with pos := s0.pos + 1 }
|
|
106
|
-
if jPeek s == some ']' then
|
|
107
|
-
pure (← emptyList, { s with pos := s.pos + 1 })
|
|
108
|
-
else do
|
|
109
|
-
let sRef ← IO.mkRef s
|
|
110
|
-
let accRef ← IO.mkRef (#[] : Array Value)
|
|
111
|
-
repeat do
|
|
112
|
-
let (v, s1) ← jVal (← sRef.get)
|
|
113
|
-
accRef.modify (·.push v)
|
|
114
|
-
let s2 := jSkipWs s1
|
|
115
|
-
let c := (jPeek s2).getD ']'
|
|
116
|
-
sRef.set { s2 with pos := s2.pos + 1 }
|
|
117
|
-
if c != ',' then break
|
|
118
|
-
pure (← newList (← accRef.get), ← sRef.get)
|
|
119
|
-
|
|
120
|
-
partial def jNum (s0 : JState) : SIO (Value × JState) := do
|
|
121
|
-
let src := s0.src
|
|
122
|
-
let mut p := s0.pos
|
|
123
|
-
let start := p
|
|
124
|
-
while p < src.size &&
|
|
125
|
-
(let c := src[p]!
|
|
126
|
-
(c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.' || c == 'e' || c == 'E') do
|
|
127
|
-
p := p + 1
|
|
128
|
-
let tok := String.ofList (src.extract start p).toList
|
|
129
|
-
pure (.num ((parseFloatJS tok).getD 0.0), { s0 with pos := p })
|
|
130
|
-
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
def jsonRead (s : String) : SIO Value := do
|
|
134
|
-
pure (← jVal { src := s.toList.toArray, pos := 0 }).1
|
|
135
|
-
|
|
136
|
-
-- ---------------- fixJSON / equality ----------------
|
|
137
|
-
|
|
138
|
-
partial def fixJson (v : Value) (flagNull : Bool) : SIO Value := do
|
|
139
|
-
match v with
|
|
140
|
-
| .noval | .null => if flagNull then pure (.str nullmark) else pure v
|
|
141
|
-
| .map id => do
|
|
142
|
-
let o ← emptyMap
|
|
143
|
-
for (k, x) in (← mapEntries id) do
|
|
144
|
-
let _ ← setprop o (.str k) (← fixJson x flagNull)
|
|
145
|
-
pure o
|
|
146
|
-
| .list id => do
|
|
147
|
-
let mut out : Array Value := #[]
|
|
148
|
-
for x in (← listItems id) do
|
|
149
|
-
out := out.push (← fixJson x flagNull)
|
|
150
|
-
newList out
|
|
151
|
-
| _ => pure v
|
|
152
|
-
|
|
153
|
-
/-- Order-independent deep equality for maps; sequence equality for lists. -/
|
|
154
|
-
partial def eqv (a b : Value) : SIO Bool := do
|
|
155
|
-
match a, b with
|
|
156
|
-
| .noval, .noval | .noval, .null | .null, .noval | .null, .null => pure true
|
|
157
|
-
| .bool x, .bool y => pure (x == y)
|
|
158
|
-
| .num x, .num y => pure (x == y)
|
|
159
|
-
| .str x, .str y => pure (x == y)
|
|
160
|
-
| .list x, .list y => do
|
|
161
|
-
let xs ← listItems x
|
|
162
|
-
let ys ← listItems y
|
|
163
|
-
if xs.size != ys.size then pure false
|
|
164
|
-
else do
|
|
165
|
-
for i in [0:xs.size] do
|
|
166
|
-
if !(← eqv xs[i]! ys[i]!) then return false
|
|
167
|
-
pure true
|
|
168
|
-
| .map x, .map y => do
|
|
169
|
-
let xes ← mapEntries x
|
|
170
|
-
let yes ← mapEntries y
|
|
171
|
-
if xes.size != yes.size then pure false
|
|
172
|
-
else do
|
|
173
|
-
for (k, v) in xes do
|
|
174
|
-
match omapGet yes k with
|
|
175
|
-
| some w =>
|
|
176
|
-
if !(← eqv v w) then return false
|
|
177
|
-
| none => return false
|
|
178
|
-
pure true
|
|
179
|
-
| _, _ => pure (a == b)
|
|
180
|
-
|
|
181
|
-
-- ---------------- match support ----------------
|
|
182
|
-
|
|
183
|
-
def strContainsSub (hay needle : String) : Bool := Id.run do
|
|
184
|
-
let h := hay.toList.toArray
|
|
185
|
-
let nd := needle.toList.toArray
|
|
186
|
-
if nd.size == 0 then return true
|
|
187
|
-
if nd.size > h.size then return false
|
|
188
|
-
for i in [0:h.size - nd.size + 1] do
|
|
189
|
-
let mut ok := true
|
|
190
|
-
for j in [0:nd.size] do
|
|
191
|
-
if h[i + j]! != nd[j]! then ok := false
|
|
192
|
-
if ok then return true
|
|
193
|
-
return false
|
|
194
|
-
|
|
195
|
-
partial def matchval (check0 base : Value) : SIO Bool := do
|
|
196
|
-
let check := if check0 == .str undefmark || check0 == .str nullmark then Value.noval
|
|
197
|
-
else check0
|
|
198
|
-
if ← eqv check base then pure true
|
|
199
|
-
else match check with
|
|
200
|
-
| .str cs => do
|
|
201
|
-
let basestr ← stringify base
|
|
202
|
-
let csArr := cs.toList.toArray
|
|
203
|
-
if csArr.size >= 2 && csArr[0]! == '/' && csArr[csArr.size - 1]! == '/' then
|
|
204
|
-
pure (Vregex.testStr (String.ofList (csArr.extract 1 (csArr.size - 1)).toList) basestr)
|
|
205
|
-
else
|
|
206
|
-
pure (strContainsSub basestr.toLower (← stringify check).toLower)
|
|
207
|
-
| .func _ => pure true
|
|
208
|
-
| _ => pure false
|
|
209
|
-
|
|
210
|
-
partial def doMatch (check base0 : Value) : SIO Unit := do
|
|
211
|
-
let base ← clone base0
|
|
212
|
-
let _ ← walk check (before := some (fun _k v _p path => do
|
|
213
|
-
if !(isnode v) then do
|
|
214
|
-
let baseval ← getpath base path
|
|
215
|
-
if ← eqv baseval v then pure ()
|
|
216
|
-
else if v == .str undefmark && isNullish baseval then pure ()
|
|
217
|
-
else if v == .str existsmark && !(isNullish baseval) then pure ()
|
|
218
|
-
else if !(← matchval v baseval) then do
|
|
219
|
-
let mut parts : List String := []
|
|
220
|
-
for x in (← listItemsOf path) do
|
|
221
|
-
parts := (← jsString x) :: parts
|
|
222
|
-
throw (IO.userError ("MATCH: " ++ String.intercalate "." parts.reverse
|
|
223
|
-
++ ": [" ++ (← stringify v) ++ "] <=> [" ++ (← stringify baseval) ++ "]"))
|
|
224
|
-
pure v))
|
|
225
|
-
pure ()
|
|
226
|
-
|
|
227
|
-
-- ---------------- result tracking ----------------
|
|
228
|
-
|
|
229
|
-
initialize npass : IO.Ref Nat ← IO.mkRef 0
|
|
230
|
-
initialize nfail : IO.Ref Nat ← IO.mkRef 0
|
|
231
|
-
initialize failures : IO.Ref (List String) ← IO.mkRef []
|
|
232
|
-
|
|
233
|
-
def record (group name : String) (ok : Bool) (msg : String) : IO Unit := do
|
|
234
|
-
if ok then npass.modify (· + 1)
|
|
235
|
-
else do
|
|
236
|
-
nfail.modify (· + 1)
|
|
237
|
-
failures.modify (("FAIL " ++ group ++ " " ++ name ++ " - " ++ msg) :: ·)
|
|
238
|
-
|
|
239
|
-
-- ---------------- per-entry runner ----------------
|
|
240
|
-
|
|
241
|
-
def omapV (kvs : List (String × Value)) : SIO Value := do
|
|
242
|
-
let m ← emptyMap
|
|
243
|
-
for (k, v) in kvs do
|
|
244
|
-
let _ ← setprop m (.str k) v
|
|
245
|
-
pure m
|
|
246
|
-
|
|
247
|
-
def entryGet (e : Value) (k : String) : SIO Value := do
|
|
248
|
-
match e with
|
|
249
|
-
| .map id => pure ((omapGet (← mapEntries id) k).getD .noval)
|
|
250
|
-
| _ => pure .noval
|
|
251
|
-
|
|
252
|
-
def entryHas (e : Value) (k : String) : SIO Bool := do
|
|
253
|
-
match e with
|
|
254
|
-
| .map id => pure (omapHas (← mapEntries id) k)
|
|
255
|
-
| _ => pure false
|
|
256
|
-
|
|
257
|
-
def resolveArgs (entry : Value) : SIO (List Value) := do
|
|
258
|
-
if ← entryHas entry "ctx" then pure [← entryGet entry "ctx"]
|
|
259
|
-
else if ← entryHas entry "args" then pure (← listItemsOf (← entryGet entry "args")).toList
|
|
260
|
-
else if ← entryHas entry "in" then pure [← clone (← entryGet entry "in")]
|
|
261
|
-
else pure [.noval]
|
|
262
|
-
|
|
263
|
-
def checkResult (entry : Value) (args : List Value) (res : Value) : SIO Unit := do
|
|
264
|
-
let mut matched := false
|
|
265
|
-
if ← entryHas entry "match" then do
|
|
266
|
-
doMatch (← entryGet entry "match")
|
|
267
|
-
(← omapV [("in", ← entryGet entry "in"), ("args", ← newList args.toArray),
|
|
268
|
-
("out", ← entryGet entry "res"), ("ctx", ← entryGet entry "ctx")])
|
|
269
|
-
matched := true
|
|
270
|
-
let out ← entryGet entry "out"
|
|
271
|
-
if ← eqv out res then pure ()
|
|
272
|
-
else if matched && (out == .str nullmark || isNullish out) then pure ()
|
|
273
|
-
else
|
|
274
|
-
throw (IO.userError ("Expected: " ++ (← stringify out) ++ ", got: " ++ (← stringify res)))
|
|
275
|
-
|
|
276
|
-
def handleError (entry : Value) (err : IO.Error) : SIO Unit := do
|
|
277
|
-
let msg := err.toString
|
|
278
|
-
if ← entryHas entry "err" then do
|
|
279
|
-
let entryErr ← entryGet entry "err"
|
|
280
|
-
if entryErr == .bool true || (← matchval entryErr (.str msg)) then do
|
|
281
|
-
if ← entryHas entry "match" then
|
|
282
|
-
doMatch (← entryGet entry "match")
|
|
283
|
-
(← omapV [("in", ← entryGet entry "in"), ("out", ← entryGet entry "res"),
|
|
284
|
-
("ctx", ← entryGet entry "ctx"), ("err", .str msg)])
|
|
285
|
-
else
|
|
286
|
-
throw (IO.userError ("ERROR MATCH: [" ++ (← stringify entryErr) ++ "] <=> [" ++ msg ++ "]"))
|
|
287
|
-
else throw err
|
|
288
|
-
|
|
289
|
-
def runSet (group : String) (node : Value) (subject : List Value → SIO Value)
|
|
290
|
-
(flagNull : Bool := true) : SIO Unit := do
|
|
291
|
-
let fixed ← fixJson node flagNull
|
|
292
|
-
let testset ← listItemsOf (← getprop fixed (.str "set"))
|
|
293
|
-
for entry in testset do
|
|
294
|
-
let name ← jsString (← entryGet entry "name")
|
|
295
|
-
try
|
|
296
|
-
if !(← entryHas entry "out") && flagNull then
|
|
297
|
-
let _ ← setprop entry (.str "out") (.str nullmark)
|
|
298
|
-
let args ← resolveArgs entry
|
|
299
|
-
let res ← fixJson (← subject args) flagNull
|
|
300
|
-
let _ ← setprop entry (.str "res") res
|
|
301
|
-
checkResult entry args res
|
|
302
|
-
record group name true ""
|
|
303
|
-
catch e =>
|
|
304
|
-
try
|
|
305
|
-
handleError entry e
|
|
306
|
-
record group name true ""
|
|
307
|
-
catch e2 =>
|
|
308
|
-
record group name false e2.toString
|
|
309
|
-
|
|
310
|
-
def getpropRawPub (e : Value) (k : String) : SIO Value := entryGet e k
|
|
311
|
-
|
|
312
|
-
def runSingle (group : String) (node : Value) (actualFn : Value → SIO Value) : SIO Unit := do
|
|
313
|
-
try
|
|
314
|
-
let expected ← getpropRawPub node "out"
|
|
315
|
-
let actual ← actualFn (← getpropRawPub node "in")
|
|
316
|
-
if ← eqv expected actual then record group "single" true ""
|
|
317
|
-
else
|
|
318
|
-
record group "single" false
|
|
319
|
-
("Expected: " ++ (← stringify expected) ++ ", got: " ++ (← stringify actual))
|
|
320
|
-
catch e => record group "single" false e.toString
|
|
6
|
+
The ENGINE is no longer in this file. It used to be: an in-tree JSON
|
|
7
|
+
reader, `fixJson`, `eqv`, `matchval`, `doMatch`, `resolveArgs`,
|
|
8
|
+
`checkResult`, `handleError` and `runSet` — this port's own copy of omni's
|
|
9
|
+
algorithm, drifting from it by construction. All of it is gone; every
|
|
10
|
+
group below is handed to omni through OmniResolver. What remains is what
|
|
11
|
+
actually belongs to this SDK: WHICH corpus group drives WHICH struct
|
|
12
|
+
function, and with which flags.
|
|
321
13
|
|
|
322
|
-
|
|
14
|
+
The file keeps its name (and the `structcorpus` executable keeps its
|
|
15
|
+
root), so no call site — Makefile, lakefile, CI — needed churn.
|
|
323
16
|
|
|
324
|
-
|
|
325
|
-
fun args => f (args.headD .noval)
|
|
17
|
+
Flags mirror canonical: typescript/test/utility/StructUtility.test.ts. -/
|
|
326
18
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
| _ => pure .noval
|
|
19
|
+
import VoxgigStruct
|
|
20
|
+
import Omni
|
|
21
|
+
import OmniResolver
|
|
331
22
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
| .map id => pure (omapHas (← mapEntries id) k)
|
|
335
|
-
| _ => pure false
|
|
23
|
+
open VoxgigStruct
|
|
24
|
+
open OmniResolver
|
|
336
25
|
|
|
337
|
-
-- ----------------
|
|
26
|
+
-- ---------------- subjects that need more than one expression ----------
|
|
338
27
|
|
|
339
28
|
def nullModifier : ModifyFn := fun v key parent _inj => do
|
|
340
29
|
if v == .str nullmark then
|
|
@@ -344,26 +33,22 @@ def nullModifier : ModifyFn := fun v key parent _inj => do
|
|
|
344
33
|
let _ ← setprop parent key (.str (s.replace nullmark "null"))
|
|
345
34
|
| _ => pure ()
|
|
346
35
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
else
|
|
364
|
-
record group "log" false
|
|
365
|
-
("Expected: " ++ (← stringify expected) ++ ", got: " ++ (← stringify log))
|
|
366
|
-
catch e => record group "log" false e.toString
|
|
36
|
+
/-- walk/log is authored as one {in, out} pair whose `out.after` is the log of
|
|
37
|
+
an after-walk. The subject builds that log and returns it; the resolver's
|
|
38
|
+
`single (out := ["after"])` selects the half the corpus asserts on. -/
|
|
39
|
+
def walkLogSubject (vin : Value) : SIO Value := do
|
|
40
|
+
let log ← emptyList
|
|
41
|
+
let walklog : WalkFn := fun key v parent path => do
|
|
42
|
+
let ks ← if isNullish key then stringify .noval else stringify key
|
|
43
|
+
let vs ← stringify v
|
|
44
|
+
let ps ← if isNullish parent then stringify .noval else stringify parent
|
|
45
|
+
let ts ← pathify path
|
|
46
|
+
let n ← size log
|
|
47
|
+
let _ ← setprop log (vInt n)
|
|
48
|
+
(.str ("k=" ++ ks ++ ", v=" ++ vs ++ ", p=" ++ ps ++ ", t=" ++ ts))
|
|
49
|
+
pure v
|
|
50
|
+
let _ ← walk vin (after := some walklog)
|
|
51
|
+
pure log
|
|
367
52
|
|
|
368
53
|
def walkCopySubject (vin : Value) : SIO Value := do
|
|
369
54
|
let cur ← IO.mkRef (← newList #[.noval])
|
|
@@ -408,127 +93,129 @@ def walkDepthSubject (vin : Value) : SIO Value := do
|
|
|
408
93
|
else
|
|
409
94
|
let _ ← setprop (← curr.get) key v
|
|
410
95
|
pure v
|
|
411
|
-
let _ ← walk (←
|
|
96
|
+
let _ ← walk (← getp vin "src") (before := some copy) (maxdepth := ← getp vin "maxdepth")
|
|
412
97
|
top.get
|
|
413
98
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
let walks ← g "walk"
|
|
418
|
-
let merges ← g "merge"
|
|
419
|
-
let getpaths ← g "getpath"
|
|
420
|
-
let injects ← g "inject"
|
|
421
|
-
let transforms ← g "transform"
|
|
422
|
-
let validates ← g "validate"
|
|
423
|
-
let selects ← g "select"
|
|
424
|
-
let sentinels ← g "sentinels"
|
|
425
|
-
let mg := getpropRawPub minor
|
|
99
|
+
-- ---------------- test groups ------------------------------------------
|
|
100
|
+
|
|
101
|
+
def runAll (r : Run) : SIO Unit := do
|
|
426
102
|
|
|
427
103
|
-- minor
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
104
|
+
runset r "minor.isnode" (getset r ["minor", "isnode"])
|
|
105
|
+
(fun v => pure (.bool (isnode v)))
|
|
106
|
+
runset r "minor.ismap" (getset r ["minor", "ismap"])
|
|
107
|
+
(fun v => pure (.bool (ismap v)))
|
|
108
|
+
runset r "minor.islist" (getset r ["minor", "islist"])
|
|
109
|
+
(fun v => pure (.bool (islist v)))
|
|
110
|
+
runset r "minor.iskey" (getset r ["minor", "iskey"])
|
|
111
|
+
(fun v => pure (.bool (iskey v))) (nullflag := false)
|
|
112
|
+
runset r "minor.strkey" (getset r ["minor", "strkey"])
|
|
113
|
+
(fun v => pure (.str (strkey v))) (nullflag := false)
|
|
114
|
+
runset r "minor.isempty" (getset r ["minor", "isempty"])
|
|
115
|
+
(fun v => do pure (.bool (← isempty v))) (nullflag := false)
|
|
116
|
+
runset r "minor.isfunc" (getset r ["minor", "isfunc"])
|
|
117
|
+
(fun v => pure (.bool (isfunc v)))
|
|
118
|
+
runset r "minor.clone" (getset r ["minor", "clone"]) clone (nullflag := false)
|
|
119
|
+
runset r "minor.escre" (getset r ["minor", "escre"]) escre
|
|
120
|
+
runset r "minor.escurl" (getset r ["minor", "escurl"]) escurl
|
|
121
|
+
runset r "minor.stringify" (getset r ["minor", "stringify"])
|
|
122
|
+
(fun vin => do
|
|
123
|
+
if ← hasp vin "val" then
|
|
124
|
+
pure (.str (← stringify (← getp vin "val") (maxlen := ← getp vin "max")))
|
|
445
125
|
else
|
|
446
|
-
pure (.str (← stringify .noval)))
|
|
447
|
-
(
|
|
448
|
-
|
|
449
|
-
(
|
|
450
|
-
pure (.str (← jsonify (←
|
|
451
|
-
(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
(
|
|
471
|
-
|
|
472
|
-
(
|
|
473
|
-
|
|
474
|
-
|
|
126
|
+
pure (.str (← stringify .noval)))
|
|
127
|
+
(nullflag := false)
|
|
128
|
+
runset r "minor.jsonify" (getset r ["minor", "jsonify"])
|
|
129
|
+
(fun vin => do
|
|
130
|
+
pure (.str (← jsonify (← getp vin "val") (flags := ← getp vin "flags"))))
|
|
131
|
+
(nullflag := false)
|
|
132
|
+
-- `alt` is read by NULLISHNESS here and by PRESENCE for getprop below.
|
|
133
|
+
-- That is canonical's own split: it omits getprop's alt only when the KEY
|
|
134
|
+
-- is missing (`undefined === vin.alt`), so a present `alt: null` still
|
|
135
|
+
-- goes through, while getelem's rule is the looser `null == vin.alt`.
|
|
136
|
+
-- `minor/getprop#50` and `#51` are the entries that separate them — and
|
|
137
|
+
-- the retired hand-written engine hid the difference, because its `eqv`
|
|
138
|
+
-- matched a no-value against a null. The vendored engine does not.
|
|
139
|
+
runset r "minor.getelem" (getset r ["minor", "getelem"])
|
|
140
|
+
(fun vin => do
|
|
141
|
+
let alt ← getp vin "alt"
|
|
142
|
+
if isNullish alt then getelem (← getp vin "val") (← getp vin "key")
|
|
143
|
+
else getelem (← getp vin "val") (← getp vin "key") alt)
|
|
144
|
+
(nullflag := false)
|
|
145
|
+
runset r "minor.delprop" (getset r ["minor", "delprop"])
|
|
146
|
+
(fun vin => do delprop (← getp vin "parent") (← getp vin "key"))
|
|
147
|
+
runset r "minor.size" (getset r ["minor", "size"])
|
|
148
|
+
(fun v => do pure (vInt (← size v))) (nullflag := false)
|
|
149
|
+
runset r "minor.slice" (getset r ["minor", "slice"])
|
|
150
|
+
(fun vin => do
|
|
151
|
+
slice (← getp vin "val") (start := ← getp vin "start") (stop := ← getp vin "end"))
|
|
152
|
+
(nullflag := false)
|
|
153
|
+
runset r "minor.pad" (getset r ["minor", "pad"])
|
|
154
|
+
(fun vin => do
|
|
155
|
+
pure (.str (← pad (← getp vin "val") (padding := ← getp vin "pad")
|
|
156
|
+
(padchar := ← getp vin "char"))))
|
|
157
|
+
(nullflag := false)
|
|
158
|
+
runset r "minor.pathify" (getset r ["minor", "pathify"])
|
|
159
|
+
(fun vin => do
|
|
160
|
+
if ← hasp vin "path" then
|
|
161
|
+
pure (.str (← pathify (← getp vin "path") (startin := ← getp vin "from")))
|
|
475
162
|
else
|
|
476
|
-
pure (.str (← pathify .noval (startin := ←
|
|
477
|
-
(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
else getprop (←
|
|
484
|
-
(
|
|
485
|
-
|
|
486
|
-
(
|
|
487
|
-
setprop (←
|
|
488
|
-
|
|
489
|
-
(
|
|
490
|
-
pure (.bool (← haskey (←
|
|
491
|
-
(
|
|
492
|
-
|
|
493
|
-
(
|
|
494
|
-
|
|
495
|
-
(
|
|
496
|
-
let url := (←
|
|
497
|
-
pure (.str (← join (←
|
|
498
|
-
(
|
|
499
|
-
|
|
500
|
-
(
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
let checkV ← vget vin "check"
|
|
163
|
+
pure (.str (← pathify .noval (startin := ← getp vin "from") (absent := true))))
|
|
164
|
+
(nullflag := false)
|
|
165
|
+
runset r "minor.items" (getset r ["minor", "items"]) items
|
|
166
|
+
runset r "minor.getprop" (getset r ["minor", "getprop"])
|
|
167
|
+
(fun vin => do
|
|
168
|
+
if ← hasp vin "alt" then
|
|
169
|
+
getprop (← getp vin "val") (← getp vin "key") (← getp vin "alt")
|
|
170
|
+
else getprop (← getp vin "val") (← getp vin "key"))
|
|
171
|
+
(nullflag := false)
|
|
172
|
+
runset r "minor.setprop" (getset r ["minor", "setprop"])
|
|
173
|
+
(fun vin => do
|
|
174
|
+
setprop (← getp vin "parent") (← getp vin "key") (← getp vin "val"))
|
|
175
|
+
runset r "minor.haskey" (getset r ["minor", "haskey"])
|
|
176
|
+
(fun vin => do
|
|
177
|
+
pure (.bool (← haskey (← getp vin "src") (← getp vin "key"))))
|
|
178
|
+
(nullflag := false)
|
|
179
|
+
runset r "minor.keysof" (getset r ["minor", "keysof"])
|
|
180
|
+
(fun v => do newList ((← keysof v).map (fun s => Value.str s)))
|
|
181
|
+
runset r "minor.join" (getset r ["minor", "join"])
|
|
182
|
+
(fun vin => do
|
|
183
|
+
let url := (← getp vin "url") == .bool true
|
|
184
|
+
pure (.str (← join (← getp vin "val") (sep := ← getp vin "sep") (url := url))))
|
|
185
|
+
(nullflag := false)
|
|
186
|
+
runset r "minor.typify" (getset r ["minor", "typify"])
|
|
187
|
+
(fun v => pure (vInt (typify v))) (nullflag := false)
|
|
188
|
+
runset r "minor.setpath" (getset r ["minor", "setpath"])
|
|
189
|
+
(fun vin => do
|
|
190
|
+
setpath (← getp vin "store") (← getp vin "path") (← getp vin "val"))
|
|
191
|
+
(nullflag := false)
|
|
192
|
+
runset r "minor.filter" (getset r ["minor", "filter"])
|
|
193
|
+
(fun vin => do
|
|
194
|
+
let checkV ← getp vin "check"
|
|
509
195
|
let check : (String × Value) → Bool :=
|
|
510
196
|
if checkV == .str "gt3" then
|
|
511
197
|
fun (_, x) => match x with | .num n => n > 3.0 | _ => false
|
|
512
198
|
else if checkV == .str "lt3" then
|
|
513
199
|
fun (_, x) => match x with | .num n => n < 3.0 | _ => false
|
|
514
200
|
else fun _ => false
|
|
515
|
-
filter (←
|
|
516
|
-
|
|
517
|
-
(
|
|
201
|
+
filter (← getp vin "val") check)
|
|
202
|
+
runset r "minor.typename" (getset r ["minor", "typename"])
|
|
203
|
+
(fun v => do
|
|
518
204
|
let t : Int := match v with
|
|
519
205
|
| .num n => fToInt n
|
|
520
206
|
| _ => 0
|
|
521
|
-
pure (.str (typename t)))
|
|
522
|
-
|
|
523
|
-
(
|
|
524
|
-
match (←
|
|
525
|
-
| .num n => flatten (←
|
|
526
|
-
| _ => flatten (←
|
|
207
|
+
pure (.str (typename t)))
|
|
208
|
+
runset r "minor.flatten" (getset r ["minor", "flatten"])
|
|
209
|
+
(fun vin => do
|
|
210
|
+
match (← getp vin "depth") with
|
|
211
|
+
| .num n => flatten (← getp vin "val") (depth := fToInt n)
|
|
212
|
+
| _ => flatten (← getp vin "val"))
|
|
527
213
|
|
|
528
214
|
-- walk
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
215
|
+
runset r "walk.log" (single (getset r ["walk", "log"]) (out := ["after"]))
|
|
216
|
+
walkLogSubject
|
|
217
|
+
runset r "walk.basic" (getset r ["walk", "basic"])
|
|
218
|
+
(fun vin => do
|
|
532
219
|
walk vin (after := some (fun _k v _p path => do
|
|
533
220
|
match v with
|
|
534
221
|
| .str s => do
|
|
@@ -536,162 +223,146 @@ def runAll (spec : Value) : SIO Unit := do
|
|
|
536
223
|
for x in (← listItemsOf path) do
|
|
537
224
|
parts := (← jsString x) :: parts
|
|
538
225
|
pure (.str (s ++ "~" ++ String.intercalate "." parts.reverse))
|
|
539
|
-
| _ => pure v)))
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
(
|
|
226
|
+
| _ => pure v)))
|
|
227
|
+
runset r "walk.copy" (getset r ["walk", "copy"]) walkCopySubject
|
|
228
|
+
runset r "walk.depth" (getset r ["walk", "depth"]) walkDepthSubject
|
|
229
|
+
(nullflag := false)
|
|
543
230
|
|
|
544
231
|
-- merge
|
|
545
|
-
|
|
232
|
+
runset r "merge.basic" (single (getset r ["merge", "basic"]))
|
|
546
233
|
(fun vin => do merge (← clone vin))
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
(
|
|
552
|
-
merge (← vget vin "val") (maxdepth := ← vget vin "depth")))
|
|
234
|
+
runset r "merge.cases" (getset r ["merge", "cases"]) (fun v => merge v)
|
|
235
|
+
runset r "merge.array" (getset r ["merge", "array"]) (fun v => merge v)
|
|
236
|
+
runset r "merge.integrity" (getset r ["merge", "integrity"]) (fun v => merge v)
|
|
237
|
+
runset r "merge.depth" (getset r ["merge", "depth"])
|
|
238
|
+
(fun vin => do merge (← getp vin "val") (maxdepth := ← getp vin "depth"))
|
|
553
239
|
|
|
554
240
|
-- getpath
|
|
555
|
-
|
|
556
|
-
(
|
|
557
|
-
|
|
558
|
-
(
|
|
559
|
-
let dpath ← match (←
|
|
241
|
+
runset r "getpath.basic" (getset r ["getpath", "basic"])
|
|
242
|
+
(fun vin => do getpath (← getp vin "store") (← getp vin "path"))
|
|
243
|
+
runset r "getpath.relative" (getset r ["getpath", "relative"])
|
|
244
|
+
(fun vin => do
|
|
245
|
+
let dpath ← match (← getp vin "dpath") with
|
|
560
246
|
| .str s => newList ((s.splitOn ".").map (fun x => Value.str x)).toArray
|
|
561
247
|
| _ => pure Value.noval
|
|
562
|
-
let d : InjDef := { dDparent := ←
|
|
563
|
-
getpath (←
|
|
564
|
-
|
|
565
|
-
(
|
|
566
|
-
let injm ←
|
|
248
|
+
let d : InjDef := { dDparent := ← getp vin "dparent", dDpath := dpath }
|
|
249
|
+
getpath (← getp vin "store") (← getp vin "path") (.idef d))
|
|
250
|
+
runset r "getpath.special" (getset r ["getpath", "special"])
|
|
251
|
+
(fun vin => do
|
|
252
|
+
let injm ← getp vin "inj"
|
|
567
253
|
let d : InjDef := {
|
|
568
254
|
dBase := ← getprop injm (.str "base"), dMeta := ← getprop injm (.str "meta"),
|
|
569
255
|
dDparent := ← getprop injm (.str "dparent"), dDpath := ← getprop injm (.str "dpath"),
|
|
570
256
|
dKey := ← getprop injm (.str "key") }
|
|
571
|
-
getpath (←
|
|
572
|
-
(if isNullish injm then .inone else .idef d))
|
|
573
|
-
|
|
574
|
-
(
|
|
257
|
+
getpath (← getp vin "store") (← getp vin "path")
|
|
258
|
+
(if isNullish injm then .inone else .idef d))
|
|
259
|
+
runset r "getpath.handler" (getset r ["getpath", "handler"])
|
|
260
|
+
(fun vin => do
|
|
575
261
|
let foo ← vFunc (fun _ _ _ _ => pure (.str "foo"))
|
|
576
|
-
let store ← omapV [("$TOP", ←
|
|
262
|
+
let store ← omapV [("$TOP", ← getp vin "store"), ("$FOO", foo)]
|
|
577
263
|
let h ← registerFunc (fun _inj v _ref _store => do
|
|
578
264
|
match v with
|
|
579
265
|
| .func fid => callFunc fid (← getDummyInj) .noval "" .noval
|
|
580
266
|
| _ => pure v)
|
|
581
267
|
let d : InjDef := { dHandler := some h }
|
|
582
|
-
getpath store (←
|
|
268
|
+
getpath store (← getp vin "path") (.idef d))
|
|
583
269
|
|
|
584
270
|
-- inject
|
|
585
|
-
|
|
271
|
+
runset r "inject.basic" (single (getset r ["inject", "basic"]))
|
|
272
|
+
(fun vin => do
|
|
273
|
+
inject (← clone (← getp vin "val")) (← clone (← getp vin "store")))
|
|
274
|
+
runset r "inject.string" (getset r ["inject", "string"])
|
|
586
275
|
(fun vin => do
|
|
587
|
-
inject (← clone (← getpropRawPub vin "val")) (← clone (← getpropRawPub vin "store")))
|
|
588
|
-
runSet "inject.string" (← getpropRawPub injects "string")
|
|
589
|
-
(arg1 (fun vin => do
|
|
590
276
|
let mid ← registerModify nullModifier
|
|
591
|
-
let d : InjDef := { dModify := some mid, dExtra := ←
|
|
592
|
-
inject (←
|
|
593
|
-
|
|
594
|
-
(
|
|
277
|
+
let d : InjDef := { dModify := some mid, dExtra := ← getp vin "current" }
|
|
278
|
+
inject (← getp vin "val") (← getp vin "store") (.idef d))
|
|
279
|
+
runset r "inject.deep" (getset r ["inject", "deep"])
|
|
280
|
+
(fun vin => do inject (← getp vin "val") (← getp vin "store"))
|
|
595
281
|
|
|
596
282
|
-- transform
|
|
597
|
-
|
|
598
|
-
(fun vin => do
|
|
599
|
-
transform (← getpropRawPub vin "data") (← getpropRawPub vin "spec"))
|
|
283
|
+
runset r "transform.basic" (single (getset r ["transform", "basic"]))
|
|
284
|
+
(fun vin => do transform (← getp vin "data") (← getp vin "spec"))
|
|
600
285
|
for gn in ["paths", "cmds", "each", "pack", "ref"] do
|
|
601
|
-
|
|
602
|
-
(
|
|
603
|
-
|
|
604
|
-
(
|
|
286
|
+
runset r ("transform." ++ gn) (getset r ["transform", gn])
|
|
287
|
+
(fun vin => do transform (← getp vin "data") (← getp vin "spec"))
|
|
288
|
+
runset r "transform.modify" (getset r ["transform", "modify"])
|
|
289
|
+
(fun vin => do
|
|
605
290
|
let mid ← registerModify (fun v key parent _inj => do
|
|
606
291
|
match v with
|
|
607
292
|
| .str s =>
|
|
608
293
|
if !(isNullish key) && !(isNullish parent) then
|
|
609
294
|
let _ ← setprop parent key (.str ("@" ++ s))
|
|
610
295
|
| _ => pure ())
|
|
611
|
-
let d : InjDef := { dModify := some mid, dExtra := ←
|
|
612
|
-
transform (←
|
|
613
|
-
|
|
614
|
-
(
|
|
615
|
-
(
|
|
616
|
-
|
|
617
|
-
(
|
|
296
|
+
let d : InjDef := { dModify := some mid, dExtra := ← getp vin "store" }
|
|
297
|
+
transform (← getp vin "data") (← getp vin "spec") (.idef d))
|
|
298
|
+
runset r "transform.format" (getset r ["transform", "format"])
|
|
299
|
+
(fun vin => do transform (← getp vin "data") (← getp vin "spec"))
|
|
300
|
+
(nullflag := false)
|
|
301
|
+
runset r "transform.apply" (getset r ["transform", "apply"])
|
|
302
|
+
(fun vin => do transform (← getp vin "data") (← getp vin "spec"))
|
|
618
303
|
|
|
619
304
|
-- validate
|
|
620
|
-
|
|
621
|
-
(
|
|
622
|
-
(
|
|
305
|
+
runset r "validate.basic" (getset r ["validate", "basic"])
|
|
306
|
+
(fun vin => do validate (← getp vin "data") (← getp vin "spec"))
|
|
307
|
+
(nullflag := false)
|
|
623
308
|
for gn in ["child", "one", "exact"] do
|
|
624
|
-
|
|
625
|
-
(
|
|
626
|
-
|
|
627
|
-
(
|
|
628
|
-
(
|
|
629
|
-
|
|
630
|
-
(
|
|
631
|
-
let injm ←
|
|
309
|
+
runset r ("validate." ++ gn) (getset r ["validate", gn])
|
|
310
|
+
(fun vin => do validate (← getp vin "data") (← getp vin "spec"))
|
|
311
|
+
runset r "validate.invalid" (getset r ["validate", "invalid"])
|
|
312
|
+
(fun vin => do validate (← getp vin "data") (← getp vin "spec"))
|
|
313
|
+
(nullflag := false)
|
|
314
|
+
runset r "validate.special" (getset r ["validate", "special"])
|
|
315
|
+
(fun vin => do
|
|
316
|
+
let injm ← getp vin "inj"
|
|
632
317
|
let d : InjDef := { dMeta := ← getprop injm (.str "meta") }
|
|
633
|
-
validate (←
|
|
634
|
-
(if isNullish injm then .inone else .idef d))
|
|
318
|
+
validate (← getp vin "data") (← getp vin "spec")
|
|
319
|
+
(if isNullish injm then .inone else .idef d))
|
|
635
320
|
|
|
636
321
|
-- select
|
|
637
322
|
for gn in ["basic", "operators", "edge", "alts"] do
|
|
638
|
-
|
|
639
|
-
(
|
|
640
|
-
|
|
641
|
-
--
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
(
|
|
668
|
-
|
|
669
|
-
(
|
|
670
|
-
pure (.bool (← haskey (←
|
|
671
|
-
(
|
|
672
|
-
|
|
673
|
-
(
|
|
674
|
-
(
|
|
675
|
-
runSet "sentinels.isnode_unify" (← getpropRawPub sentinels "isnode_unify")
|
|
676
|
-
(arg1 (fun v => pure (.bool (isnode v))))
|
|
677
|
-
(flagNull := false)
|
|
678
|
-
runSet "sentinels.stringify_null" (← getpropRawPub sentinels "stringify_null")
|
|
679
|
-
(arg1 (fun vin => do pure (.str (← stringify vin))))
|
|
680
|
-
(flagNull := false)
|
|
323
|
+
runset r ("select." ++ gn) (getset r ["select", gn])
|
|
324
|
+
(fun vin => do select (← getp vin "obj") (← getp vin "query"))
|
|
325
|
+
|
|
326
|
+
-- nullsem: does a PRESENT key holding a JSON null read as "no value"?
|
|
327
|
+
-- Every group runs {null: false} — the whole point of the section is the
|
|
328
|
+
-- distinction the null flag would erase.
|
|
329
|
+
--
|
|
330
|
+
-- This section used to be looked up as `sentinels`, under six group names
|
|
331
|
+
-- (`getprop_unify`, `getelem_absent`, `haskey_unify`, `isempty_unify`,
|
|
332
|
+
-- `isnode_unify`, `stringify_null`) the shipped corpus has never carried —
|
|
333
|
+
-- alongside a `regex` section it has never carried either. All eleven
|
|
334
|
+
-- groups therefore ran ZERO cases, silently. The vendored engine names a
|
|
335
|
+
-- missing group out loud (`SKIP`), which is how that was found; the
|
|
336
|
+
-- regex groups are gone because this port's `reTest`/`reFind`/... have no
|
|
337
|
+
-- corpus to answer, and nullsem is driven under the name it actually has.
|
|
338
|
+
runset r "nullsem.getprop" (getset r ["nullsem", "getprop"])
|
|
339
|
+
(fun vin => do
|
|
340
|
+
if ← hasp vin "alt" then
|
|
341
|
+
getprop (← getp vin "val") (← getp vin "key") (← getp vin "alt")
|
|
342
|
+
else getprop (← getp vin "val") (← getp vin "key"))
|
|
343
|
+
(nullflag := false)
|
|
344
|
+
runset r "nullsem.getelem" (getset r ["nullsem", "getelem"])
|
|
345
|
+
(fun vin => do
|
|
346
|
+
if ← hasp vin "alt" then
|
|
347
|
+
getelem (← getp vin "val") (← getp vin "key") (← getp vin "alt")
|
|
348
|
+
else getelem (← getp vin "val") (← getp vin "key"))
|
|
349
|
+
(nullflag := false)
|
|
350
|
+
runset r "nullsem.getpath" (getset r ["nullsem", "getpath"])
|
|
351
|
+
(fun vin => do getpath (← getp vin "store") (← getp vin "path"))
|
|
352
|
+
(nullflag := false)
|
|
353
|
+
runset r "nullsem.haskey" (getset r ["nullsem", "haskey"])
|
|
354
|
+
(fun vin => do
|
|
355
|
+
pure (.bool (← haskey (← getp vin "src") (← getp vin "key"))))
|
|
356
|
+
(nullflag := false)
|
|
357
|
+
runset r "nullsem.keysof" (getset r ["nullsem", "keysof"])
|
|
358
|
+
(fun v => do newList ((← keysof v).map (fun s => Value.str s)))
|
|
359
|
+
(nullflag := false)
|
|
681
360
|
|
|
682
|
-
-- ---------------- main
|
|
361
|
+
-- ---------------- main --------------------------------------------------
|
|
683
362
|
|
|
684
363
|
def main (argv : List String) : IO UInt32 := do
|
|
685
|
-
let testfile
|
|
686
|
-
let
|
|
687
|
-
let
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
let spec ← getpropRawPub alltests "struct"
|
|
691
|
-
runAll spec
|
|
692
|
-
go.run ctx
|
|
693
|
-
for f in (← failures.get).reverse do
|
|
694
|
-
IO.println f
|
|
695
|
-
IO.println ""
|
|
696
|
-
IO.println ("PASS " ++ toString (← npass.get) ++ " FAIL " ++ toString (← nfail.get))
|
|
697
|
-
if (← nfail.get) > 0 then return 1 else return 0
|
|
364
|
+
let testfile ← resolveSpecPath argv
|
|
365
|
+
let r ← makeRun testfile "struct"
|
|
366
|
+
let sctx ← mkCtx
|
|
367
|
+
(runAll r).run sctx
|
|
368
|
+
report r "STRUCT CORPUS: "
|