@voxgig/sdkgen 4.8.1 → 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 +2 -2
- 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
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
CC ?= gcc
|
|
6
6
|
CFLAGS ?= -std=c11 -Wall -Wextra -Wno-unused-parameter -D_GNU_SOURCE -O0 -g
|
|
7
7
|
INC := -I core -I utility/struct
|
|
8
|
+
# The vendored omni test runner (tests/vendor/omni) is TEST-ONLY: it is
|
|
9
|
+
# reachable from tests/ alone, never from LIB_SRCS, so it cannot enter the
|
|
10
|
+
# shipped libsdk.a. That is why it lives under tests/ and not utility/.
|
|
11
|
+
OMNI_INC := -I tests -I tests/vendor/omni
|
|
8
12
|
LDLIBS := -lm
|
|
9
13
|
|
|
10
14
|
# feature/*/*.c: a feature may carry a vendored library payload in its own
|
|
@@ -15,9 +19,14 @@ LDLIBS := -lm
|
|
|
15
19
|
LIB_SRCS := $(wildcard core/*.c utility/*.c utility/struct/*.c feature/*.c feature/*/*.c entity/*.c)
|
|
16
20
|
LIB_OBJS := $(LIB_SRCS:.c=.o)
|
|
17
21
|
|
|
22
|
+
# Single-level on purpose: the vendored omni sources under
|
|
23
|
+
# tests/vendor/omni have no main() and must not become test binaries.
|
|
18
24
|
TEST_SRCS := $(wildcard tests/*.c)
|
|
19
25
|
TEST_BINS := $(TEST_SRCS:.c=.out)
|
|
20
26
|
|
|
27
|
+
OMNI_SRCS := $(wildcard tests/vendor/omni/*.c)
|
|
28
|
+
OMNI_OBJS := $(OMNI_SRCS:.c=.o)
|
|
29
|
+
|
|
21
30
|
.PHONY: all build test clean publish
|
|
22
31
|
|
|
23
32
|
all: build
|
|
@@ -30,15 +39,40 @@ build: libsdk.a
|
|
|
30
39
|
libsdk.a: $(LIB_OBJS)
|
|
31
40
|
ar rcs $@ $(LIB_OBJS)
|
|
32
41
|
|
|
42
|
+
# omni's util.c includes <regex.h>. CFLAGS is `?=`, so an operator override
|
|
43
|
+
# can drop the -D_GNU_SOURCE that exposes it; -D_POSIX_C_SOURCE is the
|
|
44
|
+
# minimum omni itself compiles under (its own test/run.c sets exactly this).
|
|
45
|
+
# _DARWIN_C_SOURCE is needed BESIDE it, not instead of it: on Darwin,
|
|
46
|
+
# defining _POSIX_C_SOURCE alone LOWERS __DARWIN_C_LEVEL and hides regex_t,
|
|
47
|
+
# so the same flag that exposes the header on glibc hides it on macOS. Each
|
|
48
|
+
# platform ignores the other's macro.
|
|
49
|
+
tests/vendor/omni/%.o: tests/vendor/omni/%.c
|
|
50
|
+
$(CC) $(CFLAGS) -D_POSIX_C_SOURCE=200809L -D_DARWIN_C_SOURCE -c $< -o $@
|
|
51
|
+
|
|
52
|
+
libomni.a: $(OMNI_OBJS)
|
|
53
|
+
ar rcs $@ $(OMNI_OBJS)
|
|
54
|
+
|
|
55
|
+
# Only the corpus drivers and the smoke test reach for omni, and the generic
|
|
56
|
+
# rule must stay free of it: omni's util.c needs POSIX <regex.h>, which
|
|
57
|
+
# Windows does not have at all. Linking it into EVERY test binary broke the
|
|
58
|
+
# auth-null probe the generator's own suite builds on windows and macos,
|
|
59
|
+
# neither of which runs a corpus.
|
|
60
|
+
OMNI_TESTS := tests/struct_corpus_test.out tests/primary_corpus_test.out \
|
|
61
|
+
tests/omni_smoke_test.out
|
|
62
|
+
|
|
63
|
+
$(OMNI_TESTS): tests/%.out: tests/%.c libsdk.a libomni.a
|
|
64
|
+
$(CC) $(CFLAGS) $(INC) $(OMNI_INC) $< libsdk.a libomni.a -o $@ $(LDLIBS)
|
|
65
|
+
|
|
33
66
|
tests/%.out: tests/%.c libsdk.a
|
|
34
67
|
$(CC) $(CFLAGS) $(INC) $< libsdk.a -o $@ $(LDLIBS)
|
|
35
68
|
|
|
36
69
|
# Build and run every test; aggregate pass/fail.
|
|
37
|
-
test: libsdk.a
|
|
70
|
+
test: libsdk.a libomni.a
|
|
38
71
|
@fail=0; total=0; \
|
|
39
72
|
for src in $(TEST_SRCS); do \
|
|
40
73
|
bin=$${src%.c}.out; \
|
|
41
|
-
|
|
74
|
+
case " $(OMNI_TESTS) " in *" $$bin "*) omni="libomni.a"; oinc="$(OMNI_INC)";; *) omni=""; oinc="";; esac; \
|
|
75
|
+
$(CC) $(CFLAGS) $(INC) $$oinc $$src libsdk.a $$omni -o $$bin $(LDLIBS) || { echo "BUILD FAIL: $$src"; fail=1; continue; }; \
|
|
42
76
|
total=$$((total+1)); \
|
|
43
77
|
if ./$$bin; then :; else echo "TEST FAIL: $$bin"; fail=1; fi; \
|
|
44
78
|
done; \
|
|
@@ -47,7 +81,8 @@ test: libsdk.a
|
|
|
47
81
|
exit $$fail
|
|
48
82
|
|
|
49
83
|
clean:
|
|
50
|
-
rm -f $(LIB_OBJS) libsdk.a $(TEST_BINS) tests/*.out
|
|
84
|
+
rm -f $(LIB_OBJS) libsdk.a $(OMNI_OBJS) libomni.a $(TEST_BINS) tests/*.out \
|
|
85
|
+
corpus-scoreboard.json
|
|
51
86
|
|
|
52
87
|
# C has no central registry — publishing IS the git tag.
|
|
53
88
|
VERSION := $(shell cat VERSION 2>/dev/null || echo 0.0.1)
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/* The corpus test runner: vendored @voxgig/omni driven through its NATIVE
|
|
2
|
+
* API (omni_make_runner / omni_runner_run / omni_runsetflags, see
|
|
3
|
+
* tests/vendor/omni/omni.h), adapted to the subject shapes the corpus
|
|
4
|
+
* drivers already use. No compat shim is vendored: the adapter below IS
|
|
5
|
+
* the whole bridge, per language, per the vendor-tag rollout
|
|
6
|
+
* (docs/design/vendor-tag-rollout.md, Decision 4). It supersedes the whole
|
|
7
|
+
* of the retired tests/runner.h - both its engine half (run_subject) and
|
|
8
|
+
* its support half (normalize / deep_equal / brief / null_substitute,
|
|
9
|
+
* subsumed by omni_deepequal / omni_matchval / omni_stringify).
|
|
10
|
+
*
|
|
11
|
+
* C-specific decisions, each load-bearing:
|
|
12
|
+
*
|
|
13
|
+
* 1. TWO VALUE MODELS, ONE BIDIRECTIONAL BRIDGE. Every other migrated
|
|
14
|
+
* target shares one value model with its omni port and needs only a
|
|
15
|
+
* sentinel swap. C does not: omni carries its OWN arena-allocated model
|
|
16
|
+
* (omni_json + omni_pool, tests/vendor/omni/json.c) while the SDK uses
|
|
17
|
+
* the refcounted voxgig_value of utility/struct. So omnivx_tovx and
|
|
18
|
+
* omnivx_tomni below convert whole values in both directions, and the
|
|
19
|
+
* ownership rule is the SDK's own (core/sdk.h): omni values are
|
|
20
|
+
* pool-owned and freed in one go by omni_pool_free; voxgig values the
|
|
21
|
+
* bridge creates for a subject are released after the call, and values
|
|
22
|
+
* the SDK pipeline builds are never released at all.
|
|
23
|
+
*
|
|
24
|
+
* 2. "NO ARGUMENT" AND "NULL" ARE NATIVELY DISTINCT. The corpus carries
|
|
25
|
+
* entries with no `in`, `args` or `ctx`, meaning "call the subject with
|
|
26
|
+
* NO argument". The vendored C port already distinguishes that case:
|
|
27
|
+
* omni_map_get on a missing key answers a value of type OMNI_ABSENT,
|
|
28
|
+
* omni_clone preserves it, and such an entry arrives as one OMNI_ABSENT
|
|
29
|
+
* argument. So C needs neither go's novalargs spec rewrite nor a compat
|
|
30
|
+
* shim - the ONE conversion is the sentinel swap at the call boundary:
|
|
31
|
+
* OMNI_ABSENT -> voxgig_new_undef() inbound, VOXGIG_VAL_UNDEF ->
|
|
32
|
+
* omni_absent() outbound, walked, because getpath can leave an undef
|
|
33
|
+
* inside a partially-resolved node.
|
|
34
|
+
*
|
|
35
|
+
* 3. THE ARGUMENT IS WRITTEN BACK. `struct.minor.setpath` asserts
|
|
36
|
+
* `match: {args: {0: {store: ...}}}` - that the subject mutated the
|
|
37
|
+
* container it was handed - and `struct.merge.integrity` asserts the
|
|
38
|
+
* opposite for merge. The bridge hands the subject a fresh voxgig copy,
|
|
39
|
+
* so after the call omnivx_writeback rewrites the CONTENTS of the omni
|
|
40
|
+
* argument node in place (its identity is preserved, because the runner
|
|
41
|
+
* also stores it as `entry.ctx`). The retired runner.h could not check
|
|
42
|
+
* either assertion: it ignored `match` entirely.
|
|
43
|
+
*
|
|
44
|
+
* 4. NUMBERS ARE RE-TYPED ON THE WAY IN. voxgig distinguishes integer from
|
|
45
|
+
* decimal (minor.typify / minor.typename assert on it) while omni_json
|
|
46
|
+
* holds one double. The bridge classifies an integral finite double as
|
|
47
|
+
* VOXGIG_VAL_INT, which is exactly what voxgig_parse_json_file did for
|
|
48
|
+
* a literal with no '.' and no exponent - and the shared corpus holds
|
|
49
|
+
* no integral-valued decimal literal, so the two readings agree case
|
|
50
|
+
* for case.
|
|
51
|
+
*
|
|
52
|
+
* 5. VALUES OMNI CANNOT EXPRESS ARE RENDERED AS voxgig's OWN JSON FORM.
|
|
53
|
+
* VAL_FUNC (injector/modify) and the SKIP/DELETE sentinels have no omni
|
|
54
|
+
* type. Rather than let them read as "absent", the bridge renders them
|
|
55
|
+
* the way voxgig_jsonify does - a function as null, a sentinel as
|
|
56
|
+
* {"`$NAME`": true} - so an assertion that meets one sees the same text
|
|
57
|
+
* it would have seen through stringify.
|
|
58
|
+
*
|
|
59
|
+
* 6. NO EXCEPTIONS, SO NO OmniError. omni_runset returns non-zero and sets
|
|
60
|
+
* *errout to a pool-owned message; a subject reports failure by setting
|
|
61
|
+
* its `char **err` out-param, which the bridge copies into
|
|
62
|
+
* omni_result.err. This is the one documented parity exemption for the
|
|
63
|
+
* C port (tests/vendor/omni README, c:55-56).
|
|
64
|
+
*
|
|
65
|
+
* 7. omni#54 GAP 1 IS PRESENT in the vendored C port: omni_jsonstr has no
|
|
66
|
+
* cycle guard. Mitigation is java's: typed SDK state is kept OUT of the
|
|
67
|
+
* entries (a corpus subject builds its typed Context at the call site
|
|
68
|
+
* and publishes only plain data back), and the bridge carries its own
|
|
69
|
+
* depth bound, OMNIVX_MAXDEPTH, so a cyclic value becomes a marker
|
|
70
|
+
* string instead of a hang.
|
|
71
|
+
*
|
|
72
|
+
* Header-only; every helper is `static` + unused-safe, so a test binary
|
|
73
|
+
* may include it and use only part of it.
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
#ifndef PROJECTNAME_OMNI_RESOLVER_H
|
|
77
|
+
#define PROJECTNAME_OMNI_RESOLVER_H
|
|
78
|
+
|
|
79
|
+
#include "vendor/omni/omni.h"
|
|
80
|
+
#include "voxgig_struct.h"
|
|
81
|
+
|
|
82
|
+
#include <math.h>
|
|
83
|
+
#include <stdio.h>
|
|
84
|
+
#include <stdlib.h>
|
|
85
|
+
#include <string.h>
|
|
86
|
+
|
|
87
|
+
#define OMNIVX __attribute__((unused)) static
|
|
88
|
+
|
|
89
|
+
/* Deeper than any corpus value; a cyclic one is cut here rather than
|
|
90
|
+
* followed (decision 7). */
|
|
91
|
+
#define OMNIVX_MAXDEPTH 64
|
|
92
|
+
#define OMNIVX_DEPTHMARK "__DEPTH__"
|
|
93
|
+
|
|
94
|
+
/* ---- value bridge: omni -> voxgig ---------------------------------- */
|
|
95
|
+
|
|
96
|
+
OMNIVX int omnivx_isintegral(double num) {
|
|
97
|
+
/* The range test keeps the (int64_t) cast defined; outside it the value
|
|
98
|
+
* can only have come from a decimal literal anyway. */
|
|
99
|
+
return isfinite(num) && floor(num) == num && -9.0e18 <= num && num <= 9.0e18;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
OMNIVX voxgig_value* omnivx_tovx_at(const omni_json* val, int depth);
|
|
103
|
+
|
|
104
|
+
OMNIVX voxgig_value* omnivx_tovx(const omni_json* val) { return omnivx_tovx_at(val, 0); }
|
|
105
|
+
|
|
106
|
+
OMNIVX voxgig_value* omnivx_tovx_at(const omni_json* val, int depth) {
|
|
107
|
+
size_t at;
|
|
108
|
+
|
|
109
|
+
if (NULL == val) {
|
|
110
|
+
return voxgig_new_undef();
|
|
111
|
+
}
|
|
112
|
+
if (OMNIVX_MAXDEPTH < depth) {
|
|
113
|
+
return voxgig_new_string(OMNIVX_DEPTHMARK);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
switch (val->type) {
|
|
117
|
+
case OMNI_ABSENT:
|
|
118
|
+
return voxgig_new_undef();
|
|
119
|
+
case OMNI_NULL:
|
|
120
|
+
return voxgig_new_null();
|
|
121
|
+
case OMNI_BOOL:
|
|
122
|
+
return voxgig_new_bool(0 != val->boolval);
|
|
123
|
+
case OMNI_NUM:
|
|
124
|
+
return omnivx_isintegral(val->numval) ? voxgig_new_int((int64_t)val->numval)
|
|
125
|
+
: voxgig_new_double(val->numval);
|
|
126
|
+
case OMNI_STR:
|
|
127
|
+
return voxgig_new_string(NULL == val->strval ? "" : val->strval);
|
|
128
|
+
case OMNI_LIST: {
|
|
129
|
+
voxgig_value* out = voxgig_new_list();
|
|
130
|
+
for (at = 0; at < val->listlen; at++) {
|
|
131
|
+
voxgig_list_push(voxgig_as_list(out), omnivx_tovx_at(val->list[at], depth + 1));
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
case OMNI_MAP: {
|
|
136
|
+
voxgig_value* out = voxgig_new_map();
|
|
137
|
+
for (at = 0; at < val->maplen; at++) {
|
|
138
|
+
voxgig_map_set(voxgig_as_map(out), val->keys[at], omnivx_tovx_at(val->vals[at], depth + 1));
|
|
139
|
+
}
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return voxgig_new_undef();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* ---- value bridge: voxgig -> omni ---------------------------------- */
|
|
148
|
+
|
|
149
|
+
OMNIVX omni_json* omnivx_tomni_at(omni_pool* pool, voxgig_value* val, int depth);
|
|
150
|
+
|
|
151
|
+
OMNIVX omni_json* omnivx_tomni(omni_pool* pool, voxgig_value* val) {
|
|
152
|
+
return omnivx_tomni_at(pool, val, 0);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
OMNIVX omni_json* omnivx_tomni_at(omni_pool* pool, voxgig_value* val, int depth) {
|
|
156
|
+
size_t at;
|
|
157
|
+
|
|
158
|
+
if (NULL == val) {
|
|
159
|
+
return omni_absent(pool);
|
|
160
|
+
}
|
|
161
|
+
if (OMNIVX_MAXDEPTH < depth) {
|
|
162
|
+
return omni_str(pool, OMNIVX_DEPTHMARK);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
switch (val->kind) {
|
|
166
|
+
case VOXGIG_VAL_UNDEF:
|
|
167
|
+
return omni_absent(pool);
|
|
168
|
+
case VOXGIG_VAL_NULL:
|
|
169
|
+
return omni_null(pool);
|
|
170
|
+
case VOXGIG_VAL_BOOL:
|
|
171
|
+
return omni_bool(pool, voxgig_as_bool(val) ? 1 : 0);
|
|
172
|
+
case VOXGIG_VAL_INT:
|
|
173
|
+
return omni_num(pool, (double)voxgig_as_int(val));
|
|
174
|
+
case VOXGIG_VAL_DOUBLE:
|
|
175
|
+
return omni_num(pool, voxgig_as_double(val));
|
|
176
|
+
case VOXGIG_VAL_STRING: {
|
|
177
|
+
const char* str = voxgig_as_string(val);
|
|
178
|
+
return omni_str(pool, NULL == str ? "" : str);
|
|
179
|
+
}
|
|
180
|
+
case VOXGIG_VAL_LIST: {
|
|
181
|
+
voxgig_list* list = voxgig_as_list(val);
|
|
182
|
+
omni_json* out = omni_list(pool);
|
|
183
|
+
for (at = 0; at < list->len; at++) {
|
|
184
|
+
omni_list_push(out, omnivx_tomni_at(pool, list->items[at], depth + 1));
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
}
|
|
188
|
+
case VOXGIG_VAL_MAP: {
|
|
189
|
+
voxgig_map* map = voxgig_as_map(val);
|
|
190
|
+
omni_json* out = omni_map(pool);
|
|
191
|
+
for (at = 0; at < map->len; at++) {
|
|
192
|
+
omni_map_set(out, map->entries[at].key,
|
|
193
|
+
omnivx_tomni_at(pool, map->entries[at].value, depth + 1));
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
case VOXGIG_VAL_FUNC:
|
|
198
|
+
/* voxgig_jsonify renders a callable as null; so does the bridge. */
|
|
199
|
+
return omni_null(pool);
|
|
200
|
+
case VOXGIG_VAL_SENTINEL: {
|
|
201
|
+
/* voxgig_jsonify renders a sentinel as {"`$NAME`": true}. */
|
|
202
|
+
const voxgig_sentinel* sent = voxgig_as_sentinel(val);
|
|
203
|
+
omni_json* out = omni_map(pool);
|
|
204
|
+
char key[64];
|
|
205
|
+
snprintf(key, sizeof(key), "`$%s`", (NULL != sent && NULL != sent->name) ? sent->name : "?");
|
|
206
|
+
omni_map_set(out, key, omni_bool(pool, 1));
|
|
207
|
+
return out;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return omni_absent(pool);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* ---- argument write-back (decision 3) ------------------------------ */
|
|
215
|
+
|
|
216
|
+
/* Rewrite the CONTENTS of `dst` from `src`, keeping dst's identity: the
|
|
217
|
+
* runner stored that very node as the entry's `args[0]` and `ctx`, and a
|
|
218
|
+
* `match` assertion reads through it. Containers only - a scalar argument
|
|
219
|
+
* cannot be mutated by the subject in a way the corpus can observe. */
|
|
220
|
+
OMNIVX void omnivx_writeback(omni_pool* pool, omni_json* dst, voxgig_value* src) {
|
|
221
|
+
size_t at;
|
|
222
|
+
|
|
223
|
+
if (NULL == dst || NULL == src) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (OMNI_MAP == dst->type && voxgig_is_map(src)) {
|
|
228
|
+
voxgig_map* map = voxgig_as_map(src);
|
|
229
|
+
dst->maplen = 0;
|
|
230
|
+
for (at = 0; at < map->len; at++) {
|
|
231
|
+
omni_map_set(dst, map->entries[at].key, omnivx_tomni_at(pool, map->entries[at].value, 1));
|
|
232
|
+
}
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (OMNI_LIST == dst->type && voxgig_is_list(src)) {
|
|
237
|
+
voxgig_list* list = voxgig_as_list(src);
|
|
238
|
+
dst->listlen = 0;
|
|
239
|
+
for (at = 0; at < list->len; at++) {
|
|
240
|
+
omni_list_push(dst, omnivx_tomni_at(pool, list->items[at], 1));
|
|
241
|
+
}
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* ---- subjects ------------------------------------------------------ */
|
|
247
|
+
|
|
248
|
+
/* The struct-corpus subject shape: one value in, one value out, with an
|
|
249
|
+
* optional error message. Unchanged from the retired runner.h, so every
|
|
250
|
+
* corpus subject in tests/struct_corpus_test.c crossed over verbatim. */
|
|
251
|
+
typedef voxgig_value* (*omnivx_subject_fn)(voxgig_value* in, char** err, void* ud);
|
|
252
|
+
|
|
253
|
+
typedef struct omnivx_holder {
|
|
254
|
+
omni_subject sub; /* FIRST: `sub.data` points back at the holder */
|
|
255
|
+
omni_pool* pool;
|
|
256
|
+
omnivx_subject_fn fn;
|
|
257
|
+
void* ud;
|
|
258
|
+
} omnivx_holder;
|
|
259
|
+
|
|
260
|
+
OMNIVX omni_result omnivx_call(omni_subject* self, omni_json** args, size_t nargs) {
|
|
261
|
+
omnivx_holder* holder = (omnivx_holder*)self->data;
|
|
262
|
+
omni_result out;
|
|
263
|
+
voxgig_value* in;
|
|
264
|
+
voxgig_value* got;
|
|
265
|
+
char* err = NULL;
|
|
266
|
+
|
|
267
|
+
out.val = NULL;
|
|
268
|
+
out.err = NULL;
|
|
269
|
+
|
|
270
|
+
/* nargs is 1 with an OMNI_ABSENT argument for a no-argument entry
|
|
271
|
+
* (decision 2); nargs is 0 only for an explicit `args: []`. */
|
|
272
|
+
in = 0 < nargs ? omnivx_tovx(args[0]) : voxgig_new_undef();
|
|
273
|
+
|
|
274
|
+
got = holder->fn(in, &err, holder->ud);
|
|
275
|
+
|
|
276
|
+
if (0 < nargs) {
|
|
277
|
+
omnivx_writeback(holder->pool, args[0], in);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (NULL != err) {
|
|
281
|
+
out.err = omni_pool_strdup(holder->pool, err);
|
|
282
|
+
free(err);
|
|
283
|
+
} else {
|
|
284
|
+
out.val = omnivx_tomni(holder->pool, got);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
voxgig_release(got);
|
|
288
|
+
voxgig_release(in);
|
|
289
|
+
|
|
290
|
+
return out;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
OMNIVX omni_subject* omnivx_subject(omni_pool* pool, omnivx_subject_fn fn, void* ud) {
|
|
294
|
+
omnivx_holder* holder = (omnivx_holder*)omni_pool_alloc(pool, sizeof(omnivx_holder));
|
|
295
|
+
holder->sub.call = omnivx_call;
|
|
296
|
+
holder->sub.data = holder;
|
|
297
|
+
holder->pool = pool;
|
|
298
|
+
holder->fn = fn;
|
|
299
|
+
holder->ud = ud;
|
|
300
|
+
return &holder->sub;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* The raw subject shape: omni values straight through. The primary corpus
|
|
304
|
+
* uses it because its entries assert on `ctx`, which the subject must
|
|
305
|
+
* publish back into the very omni map the runner handed it (java's
|
|
306
|
+
* decision 1: contexts stay MAPS across the runner, and the typed Context
|
|
307
|
+
* is built and synced at the call site). */
|
|
308
|
+
typedef omni_result (*omnivx_raw_fn)(omni_pool* pool, omni_json** args, size_t nargs, void* ud);
|
|
309
|
+
|
|
310
|
+
typedef struct omnivx_rawholder {
|
|
311
|
+
omni_subject sub; /* FIRST */
|
|
312
|
+
omni_pool* pool;
|
|
313
|
+
omnivx_raw_fn fn;
|
|
314
|
+
void* ud;
|
|
315
|
+
} omnivx_rawholder;
|
|
316
|
+
|
|
317
|
+
OMNIVX omni_result omnivx_rawcall(omni_subject* self, omni_json** args, size_t nargs) {
|
|
318
|
+
omnivx_rawholder* holder = (omnivx_rawholder*)self->data;
|
|
319
|
+
return holder->fn(holder->pool, args, nargs, holder->ud);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
OMNIVX omni_subject* omnivx_rawsubject(omni_pool* pool, omnivx_raw_fn fn, void* ud) {
|
|
323
|
+
omnivx_rawholder* holder = (omnivx_rawholder*)omni_pool_alloc(pool, sizeof(omnivx_rawholder));
|
|
324
|
+
holder->sub.call = omnivx_rawcall;
|
|
325
|
+
holder->sub.data = holder;
|
|
326
|
+
holder->pool = pool;
|
|
327
|
+
holder->fn = fn;
|
|
328
|
+
holder->ud = ud;
|
|
329
|
+
return &holder->sub;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/* ---- spec helpers -------------------------------------------------- */
|
|
333
|
+
|
|
334
|
+
/* How many entries a resolved test spec holds. Zero for a spec that is
|
|
335
|
+
* absent, or that carries no `set` list - which the corpus drivers report
|
|
336
|
+
* as a FAILURE, because a section that runs no case proves nothing. */
|
|
337
|
+
OMNIVX size_t omnivx_setsize(const omni_json* testspec) {
|
|
338
|
+
const omni_json* set = omni_map_get(testspec, "set");
|
|
339
|
+
return omni_islist(set) ? set->listlen : 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Wrap a bare {in, out} node - `struct.merge.basic` and
|
|
343
|
+
* `struct.inject.basic` are authored that way, with no `set` - as a
|
|
344
|
+
* one-entry set the runner can drive. Without this they scored 0/0 and
|
|
345
|
+
* asserted nothing. */
|
|
346
|
+
OMNIVX omni_json* omnivx_oneset(omni_pool* pool, omni_json* entry) {
|
|
347
|
+
omni_json* spec = omni_map(pool);
|
|
348
|
+
omni_json* set = omni_list(pool);
|
|
349
|
+
omni_list_push(set, entry);
|
|
350
|
+
omni_map_set(spec, "set", set);
|
|
351
|
+
return spec;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* omni's flags, with the failure-message label filled in. */
|
|
355
|
+
OMNIVX omni_flags omnivx_flags(int donull, const char* name) {
|
|
356
|
+
omni_flags flags = donull ? omni_flags_default() : omni_flags_nonull();
|
|
357
|
+
flags.name = name;
|
|
358
|
+
return flags;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
#endif /* PROJECTNAME_OMNI_RESOLVER_H */
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/* Smoke tests for the VENDORED omni runner itself (tests/vendor/omni),
|
|
2
|
+
* and for the voxgig<->omni bridge in tests/omni_resolver.h.
|
|
3
|
+
*
|
|
4
|
+
* A runner that cannot FAIL a bad entry would turn every corpus suite
|
|
5
|
+
* vacuously green, so the failure paths are pinned here, not just the
|
|
6
|
+
* happy one. (The C peer of tm/ts/test/omni.test.ts,
|
|
7
|
+
* tm/go/test/omnismoke_test.go and tm/java/test/OmniSmokeTest.java.)
|
|
8
|
+
*
|
|
9
|
+
* The subjects go through omnivx_subject, so the bridge is on every path:
|
|
10
|
+
* if the omni->voxgig or voxgig->omni conversion breaks, `passes a correct
|
|
11
|
+
* subject` goes red here before the corpus suites have to explain it.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#include "ctest.h" /* CHECK/CHECK_TRUE + api.h */
|
|
15
|
+
#include "omni_resolver.h" /* vendored omni + the voxgig<->omni bridge */
|
|
16
|
+
#include "voxgig_struct.h"
|
|
17
|
+
|
|
18
|
+
#include <stdio.h>
|
|
19
|
+
#include <stdlib.h>
|
|
20
|
+
#include <string.h>
|
|
21
|
+
|
|
22
|
+
static omni_pool* POOL = NULL;
|
|
23
|
+
|
|
24
|
+
/* A minimal in-memory spec: no fixture file, no OMNI block (lenient v0,
|
|
25
|
+
* like the shared corpus). Built with omni's own constructors, because
|
|
26
|
+
* omni_make_runner takes either a path or an already-parsed spec. */
|
|
27
|
+
static omni_json* smoke_spec(void) {
|
|
28
|
+
omni_json* spec = omni_map(POOL);
|
|
29
|
+
omni_json* primary = omni_map(POOL);
|
|
30
|
+
omni_json* smoke = omni_map(POOL);
|
|
31
|
+
omni_json* group;
|
|
32
|
+
omni_json* set;
|
|
33
|
+
omni_json* entry;
|
|
34
|
+
|
|
35
|
+
/* basic: two entries the subject satisfies. */
|
|
36
|
+
group = omni_map(POOL);
|
|
37
|
+
set = omni_list(POOL);
|
|
38
|
+
entry = omni_map(POOL);
|
|
39
|
+
omni_map_set(entry, "in", omni_num(POOL, 1));
|
|
40
|
+
omni_map_set(entry, "out", omni_num(POOL, 2));
|
|
41
|
+
omni_list_push(set, entry);
|
|
42
|
+
entry = omni_map(POOL);
|
|
43
|
+
omni_map_set(entry, "in", omni_num(POOL, 41));
|
|
44
|
+
omni_map_set(entry, "out", omni_num(POOL, 42));
|
|
45
|
+
omni_list_push(set, entry);
|
|
46
|
+
omni_map_set(group, "set", set);
|
|
47
|
+
omni_map_set(smoke, "basic", group);
|
|
48
|
+
|
|
49
|
+
/* bad: the same subject must NOT satisfy this one. */
|
|
50
|
+
group = omni_map(POOL);
|
|
51
|
+
set = omni_list(POOL);
|
|
52
|
+
entry = omni_map(POOL);
|
|
53
|
+
omni_map_set(entry, "in", omni_num(POOL, 1));
|
|
54
|
+
omni_map_set(entry, "out", omni_num(POOL, 999));
|
|
55
|
+
omni_list_push(set, entry);
|
|
56
|
+
omni_map_set(group, "set", set);
|
|
57
|
+
omni_map_set(smoke, "bad", group);
|
|
58
|
+
|
|
59
|
+
/* err: the subject is expected to fail on 0. */
|
|
60
|
+
group = omni_map(POOL);
|
|
61
|
+
set = omni_list(POOL);
|
|
62
|
+
entry = omni_map(POOL);
|
|
63
|
+
omni_map_set(entry, "in", omni_num(POOL, 0));
|
|
64
|
+
omni_map_set(entry, "err", omni_str(POOL, "zero refused"));
|
|
65
|
+
omni_list_push(set, entry);
|
|
66
|
+
omni_map_set(group, "set", set);
|
|
67
|
+
omni_map_set(smoke, "err", group);
|
|
68
|
+
|
|
69
|
+
/* nested: a map+list result, so the bridge is exercised on containers
|
|
70
|
+
* and on the integer/decimal split, not only on scalars. */
|
|
71
|
+
group = omni_map(POOL);
|
|
72
|
+
set = omni_list(POOL);
|
|
73
|
+
entry = omni_map(POOL);
|
|
74
|
+
omni_map_set(entry, "in", omni_num(POOL, 2));
|
|
75
|
+
{
|
|
76
|
+
omni_json* out = omni_map(POOL);
|
|
77
|
+
omni_json* list = omni_list(POOL);
|
|
78
|
+
omni_list_push(list, omni_num(POOL, 2));
|
|
79
|
+
omni_list_push(list, omni_num(POOL, 2.5));
|
|
80
|
+
omni_map_set(out, "n", omni_num(POOL, 3));
|
|
81
|
+
omni_map_set(out, "seen", list);
|
|
82
|
+
omni_map_set(out, "flag", omni_bool(POOL, 1));
|
|
83
|
+
omni_map_set(entry, "out", out);
|
|
84
|
+
}
|
|
85
|
+
omni_list_push(set, entry);
|
|
86
|
+
omni_map_set(group, "set", set);
|
|
87
|
+
omni_map_set(smoke, "nested", group);
|
|
88
|
+
|
|
89
|
+
omni_map_set(primary, "smoke", smoke);
|
|
90
|
+
omni_map_set(spec, "primary", primary);
|
|
91
|
+
|
|
92
|
+
return spec;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* The subject under test, in the struct-corpus shape the resolver adapts:
|
|
96
|
+
* increment, and refuse zero. */
|
|
97
|
+
static voxgig_value* smoke_inc(voxgig_value* in, char** err, void* ud) {
|
|
98
|
+
(void)ud;
|
|
99
|
+
if (!voxgig_is_number(in)) {
|
|
100
|
+
*err = strdup("smoke: not a number");
|
|
101
|
+
return voxgig_new_undef();
|
|
102
|
+
}
|
|
103
|
+
if (0 == voxgig_as_double(in)) {
|
|
104
|
+
*err = strdup("smoke: zero refused");
|
|
105
|
+
return voxgig_new_undef();
|
|
106
|
+
}
|
|
107
|
+
return voxgig_new_int((int64_t)voxgig_as_double(in) + 1);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Echoes its argument, so an entry that EXPECTS an error must fail. */
|
|
111
|
+
static voxgig_value* smoke_echo(voxgig_value* in, char** err, void* ud) {
|
|
112
|
+
(void)err;
|
|
113
|
+
(void)ud;
|
|
114
|
+
return voxgig_retain(in);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Builds the nested result the `nested` group pins. */
|
|
118
|
+
static voxgig_value* smoke_nested(voxgig_value* in, char** err, void* ud) {
|
|
119
|
+
(void)err;
|
|
120
|
+
(void)ud;
|
|
121
|
+
voxgig_value* out = voxgig_new_map();
|
|
122
|
+
voxgig_value* seen = voxgig_new_list();
|
|
123
|
+
double num = voxgig_is_number(in) ? voxgig_as_double(in) : 0;
|
|
124
|
+
voxgig_list_push(voxgig_as_list(seen), voxgig_new_int((int64_t)num));
|
|
125
|
+
voxgig_list_push(voxgig_as_list(seen), voxgig_new_double(num + 0.5));
|
|
126
|
+
voxgig_map_set(voxgig_as_map(out), "n", voxgig_new_int((int64_t)num + 1));
|
|
127
|
+
voxgig_map_set(voxgig_as_map(out), "seen", seen);
|
|
128
|
+
voxgig_map_set(voxgig_as_map(out), "flag", voxgig_new_bool(true));
|
|
129
|
+
return out;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
static omni_runpack* smoke_pack(void) {
|
|
133
|
+
char* err = NULL;
|
|
134
|
+
omni_runner* runner = omni_make_runner(POOL, NULL, smoke_spec(), NULL, &err);
|
|
135
|
+
if (NULL == runner) {
|
|
136
|
+
fprintf(stderr, "omni smoke: cannot make runner: %s\n", NULL == err ? "?" : err);
|
|
137
|
+
return NULL;
|
|
138
|
+
}
|
|
139
|
+
return omni_runner_run(runner, "smoke", NULL, &err);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
int main(void) {
|
|
143
|
+
omni_runpack* pack;
|
|
144
|
+
char* err;
|
|
145
|
+
int failed;
|
|
146
|
+
|
|
147
|
+
POOL = omni_pool_new();
|
|
148
|
+
|
|
149
|
+
pack = smoke_pack();
|
|
150
|
+
CHECK(NULL != pack, "smoke spec section resolved");
|
|
151
|
+
if (NULL == pack) {
|
|
152
|
+
TEST_SUMMARY("omni_smoke");
|
|
153
|
+
}
|
|
154
|
+
CHECK(omni_ismap(omni_spec(pack)), "smoke spec is a map");
|
|
155
|
+
|
|
156
|
+
/* 1. A correct subject passes — and with it the whole bridge. */
|
|
157
|
+
err = NULL;
|
|
158
|
+
failed = omni_runset(pack, omni_set(pack, "basic"), omnivx_subject(POOL, smoke_inc, NULL), &err);
|
|
159
|
+
CHECK(0 == failed, "runset passes a correct subject");
|
|
160
|
+
if (failed) {
|
|
161
|
+
fprintf(stderr, " %s\n", NULL == err ? "(no message)" : err);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* 2. A container result round-trips through the bridge unchanged. */
|
|
165
|
+
err = NULL;
|
|
166
|
+
failed =
|
|
167
|
+
omni_runset(pack, omni_set(pack, "nested"), omnivx_subject(POOL, smoke_nested, NULL), &err);
|
|
168
|
+
CHECK(0 == failed, "runset passes a nested map/list result through the bridge");
|
|
169
|
+
if (failed) {
|
|
170
|
+
fprintf(stderr, " %s\n", NULL == err ? "(no message)" : err);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* 3. A WRONG result must be reported. A runner that stays green here
|
|
174
|
+
* would make every corpus suite vacuously green. */
|
|
175
|
+
err = NULL;
|
|
176
|
+
failed = omni_runset(pack, omni_set(pack, "bad"), omnivx_subject(POOL, smoke_inc, NULL), &err);
|
|
177
|
+
CHECK(0 != failed, "runset FAILS a wrong result");
|
|
178
|
+
CHECK(NULL != err && NULL != strstr(err, "result mismatch"),
|
|
179
|
+
"the failure names a result mismatch");
|
|
180
|
+
|
|
181
|
+
/* 4. An expected error is matched... */
|
|
182
|
+
err = NULL;
|
|
183
|
+
failed = omni_runset(pack, omni_set(pack, "err"), omnivx_subject(POOL, smoke_inc, NULL), &err);
|
|
184
|
+
CHECK(0 == failed, "an expected error is matched");
|
|
185
|
+
|
|
186
|
+
/* ...and a subject that does NOT fail must fail that same entry. */
|
|
187
|
+
err = NULL;
|
|
188
|
+
failed = omni_runset(pack, omni_set(pack, "err"), omnivx_subject(POOL, smoke_echo, NULL), &err);
|
|
189
|
+
CHECK(0 != failed, "a missing expected error is reported");
|
|
190
|
+
CHECK(NULL != err && NULL != strstr(err, "expected error did not occur"),
|
|
191
|
+
"the failure names the missing error");
|
|
192
|
+
|
|
193
|
+
/* 5. A missing subject is refused rather than skipped. */
|
|
194
|
+
err = NULL;
|
|
195
|
+
failed = omni_runset(pack, omni_set(pack, "basic"), NULL, &err);
|
|
196
|
+
CHECK(0 != failed, "a missing subject is refused");
|
|
197
|
+
|
|
198
|
+
/* 6. A spec section with no `set` is refused rather than passing
|
|
199
|
+
* vacuously — the guard the corpus drivers rely on. */
|
|
200
|
+
err = NULL;
|
|
201
|
+
failed = omni_runset(pack, omni_map(POOL), omnivx_subject(POOL, smoke_inc, NULL), &err);
|
|
202
|
+
CHECK(0 != failed, "a spec with no set is refused");
|
|
203
|
+
|
|
204
|
+
/* 7. The bridge keeps "no value at all" distinct from null: an
|
|
205
|
+
* OMNI_ABSENT argument must reach the subject as UNDEF, not as null. */
|
|
206
|
+
{
|
|
207
|
+
voxgig_value* got = omnivx_tovx(omni_absent(POOL));
|
|
208
|
+
CHECK(voxgig_is_undef(got), "OMNI_ABSENT crosses as voxgig undef");
|
|
209
|
+
voxgig_release(got);
|
|
210
|
+
got = omnivx_tovx(omni_null(POOL));
|
|
211
|
+
CHECK(voxgig_is_null(got), "OMNI_NULL crosses as voxgig null");
|
|
212
|
+
voxgig_release(got);
|
|
213
|
+
}
|
|
214
|
+
{
|
|
215
|
+
voxgig_value* undef = voxgig_new_undef();
|
|
216
|
+
voxgig_value* nul = voxgig_new_null();
|
|
217
|
+
CHECK(OMNI_ABSENT == omnivx_tomni(POOL, undef)->type, "voxgig undef crosses as OMNI_ABSENT");
|
|
218
|
+
CHECK(OMNI_NULL == omnivx_tomni(POOL, nul)->type, "voxgig null crosses as OMNI_NULL");
|
|
219
|
+
voxgig_release(undef);
|
|
220
|
+
voxgig_release(nul);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* 8. An integral double crosses as an INTEGER, so minor.typify and
|
|
224
|
+
* minor.typename read the same type the JSON parser gave them. */
|
|
225
|
+
{
|
|
226
|
+
voxgig_value* whole = omnivx_tovx(omni_num(POOL, 5));
|
|
227
|
+
voxgig_value* frac = omnivx_tovx(omni_num(POOL, 5.5));
|
|
228
|
+
CHECK(voxgig_is_int(whole), "an integral number crosses as voxgig int");
|
|
229
|
+
CHECK(voxgig_is_double(frac), "a fractional number crosses as voxgig double");
|
|
230
|
+
voxgig_release(whole);
|
|
231
|
+
voxgig_release(frac);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
omni_pool_free(POOL);
|
|
235
|
+
|
|
236
|
+
TEST_SUMMARY("omni_smoke");
|
|
237
|
+
}
|