@voxgig/sdkgen-langpack 0.0.1
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/.sdk/model/target/dart.aon +63 -0
- package/.sdk/model/target/haskell.aon +72 -0
- package/.sdk/model/target/lean.aon +91 -0
- package/.sdk/src/cmp/dart/Config_dart.ts +248 -0
- package/.sdk/src/cmp/dart/EntityBase_dart.ts +34 -0
- package/.sdk/src/cmp/dart/EntityOperation_dart.ts +43 -0
- package/.sdk/src/cmp/dart/EntityTypes_dart.ts +207 -0
- package/.sdk/src/cmp/dart/Entity_dart.ts +87 -0
- package/.sdk/src/cmp/dart/Gitignore_dart.ts +34 -0
- package/.sdk/src/cmp/dart/MainEntity_dart.ts +33 -0
- package/.sdk/src/cmp/dart/Main_dart.ts +178 -0
- package/.sdk/src/cmp/dart/Package_dart.ts +82 -0
- package/.sdk/src/cmp/dart/ReadmeEntity_dart.ts +177 -0
- package/.sdk/src/cmp/dart/ReadmeExamplesTest_dart.ts +238 -0
- package/.sdk/src/cmp/dart/ReadmeExplanation_dart.ts +53 -0
- package/.sdk/src/cmp/dart/ReadmeHowto_dart.ts +152 -0
- package/.sdk/src/cmp/dart/ReadmeInstall_dart.ts +59 -0
- package/.sdk/src/cmp/dart/ReadmeIntro_dart.ts +65 -0
- package/.sdk/src/cmp/dart/ReadmeModel_dart.ts +151 -0
- package/.sdk/src/cmp/dart/ReadmeOptions_dart.ts +63 -0
- package/.sdk/src/cmp/dart/ReadmeQuick_dart.ts +225 -0
- package/.sdk/src/cmp/dart/ReadmeRef_dart.ts +397 -0
- package/.sdk/src/cmp/dart/ReadmeTopHowto_dart.ts +24 -0
- package/.sdk/src/cmp/dart/ReadmeTopQuick_dart.ts +106 -0
- package/.sdk/src/cmp/dart/ReadmeTopTest_dart.ts +78 -0
- package/.sdk/src/cmp/dart/SdkError_dart.ts +42 -0
- package/.sdk/src/cmp/dart/TestDirect_dart.ts +516 -0
- package/.sdk/src/cmp/dart/TestEntity_dart.ts +628 -0
- package/.sdk/src/cmp/dart/Test_dart.ts +138 -0
- package/.sdk/src/cmp/dart/fragment/Config.data.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/Config.fragment.dart +70 -0
- package/.sdk/src/cmp/dart/fragment/Direct.test.fragment.dart +25 -0
- package/.sdk/src/cmp/dart/fragment/Entity.fragment.dart +29 -0
- package/.sdk/src/cmp/dart/fragment/Entity.test.fragment.dart +28 -0
- package/.sdk/src/cmp/dart/fragment/EntityBase.fragment.dart +302 -0
- package/.sdk/src/cmp/dart/fragment/EntityCreateOp.fragment.dart +98 -0
- package/.sdk/src/cmp/dart/fragment/EntityListOp.fragment.dart +90 -0
- package/.sdk/src/cmp/dart/fragment/EntityLoadOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/EntityRemoveOp.fragment.dart +108 -0
- package/.sdk/src/cmp/dart/fragment/EntityUpdateOp.fragment.dart +102 -0
- package/.sdk/src/cmp/dart/fragment/Main.fragment.dart +339 -0
- package/.sdk/src/cmp/dart/fragment/SdkError.fragment.dart +26 -0
- package/.sdk/src/cmp/dart/tsconfig.json +15 -0
- package/.sdk/src/cmp/dart/utility_dart.ts +155 -0
- package/.sdk/src/cmp/haskell/Config_haskell.ts +98 -0
- package/.sdk/src/cmp/haskell/Entity_haskell.ts +13 -0
- package/.sdk/src/cmp/haskell/Gitignore_haskell.ts +27 -0
- package/.sdk/src/cmp/haskell/Main_haskell.ts +123 -0
- package/.sdk/src/cmp/haskell/Package_haskell.ts +60 -0
- package/.sdk/src/cmp/haskell/ReadmeEntity_haskell.ts +186 -0
- package/.sdk/src/cmp/haskell/ReadmeExamplesTest_haskell.ts +135 -0
- package/.sdk/src/cmp/haskell/ReadmeExplanation_haskell.ts +48 -0
- package/.sdk/src/cmp/haskell/ReadmeHowto_haskell.ts +168 -0
- package/.sdk/src/cmp/haskell/ReadmeInstall_haskell.ts +51 -0
- package/.sdk/src/cmp/haskell/ReadmeIntro_haskell.ts +67 -0
- package/.sdk/src/cmp/haskell/ReadmeModel_haskell.ts +162 -0
- package/.sdk/src/cmp/haskell/ReadmeOptions_haskell.ts +74 -0
- package/.sdk/src/cmp/haskell/ReadmeQuick_haskell.ts +241 -0
- package/.sdk/src/cmp/haskell/ReadmeRef_haskell.ts +408 -0
- package/.sdk/src/cmp/haskell/ReadmeTopHowto_haskell.ts +31 -0
- package/.sdk/src/cmp/haskell/ReadmeTopQuick_haskell.ts +104 -0
- package/.sdk/src/cmp/haskell/ReadmeTopTest_haskell.ts +80 -0
- package/.sdk/src/cmp/haskell/Test_haskell.ts +297 -0
- package/.sdk/src/cmp/haskell/tsconfig.json +15 -0
- package/.sdk/src/cmp/haskell/utility_haskell.ts +166 -0
- package/.sdk/src/cmp/lean/Config_lean.ts +93 -0
- package/.sdk/src/cmp/lean/Entity_lean.ts +9 -0
- package/.sdk/src/cmp/lean/Gitignore_lean.ts +18 -0
- package/.sdk/src/cmp/lean/Main_lean.ts +120 -0
- package/.sdk/src/cmp/lean/Package_lean.ts +93 -0
- package/.sdk/src/cmp/lean/ReadmeEntity_lean.ts +29 -0
- package/.sdk/src/cmp/lean/ReadmeExplanation_lean.ts +19 -0
- package/.sdk/src/cmp/lean/ReadmeHowto_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +39 -0
- package/.sdk/src/cmp/lean/ReadmeIntro_lean.ts +25 -0
- package/.sdk/src/cmp/lean/ReadmeModel_lean.ts +24 -0
- package/.sdk/src/cmp/lean/ReadmeOptions_lean.ts +22 -0
- package/.sdk/src/cmp/lean/ReadmeQuick_lean.ts +50 -0
- package/.sdk/src/cmp/lean/ReadmeRef_lean.ts +40 -0
- package/.sdk/src/cmp/lean/ReadmeTopHowto_lean.ts +16 -0
- package/.sdk/src/cmp/lean/ReadmeTopQuick_lean.ts +23 -0
- package/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +19 -0
- package/.sdk/src/cmp/lean/Test_lean.ts +261 -0
- package/.sdk/src/cmp/lean/utility_lean.ts +129 -0
- package/.sdk/tm/dart/LICENSE +22 -0
- package/.sdk/tm/dart/Makefile +50 -0
- package/.sdk/tm/dart/lib/Context.dart +150 -0
- package/.sdk/tm/dart/lib/Control.dart +15 -0
- package/.sdk/tm/dart/lib/Operation.dart +31 -0
- package/.sdk/tm/dart/lib/Point.dart +51 -0
- package/.sdk/tm/dart/lib/Response.dart +32 -0
- package/.sdk/tm/dart/lib/Result.dart +39 -0
- package/.sdk/tm/dart/lib/Spec.dart +49 -0
- package/.sdk/tm/dart/lib/feature/audit/AuditFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/base/BaseFeature.dart +76 -0
- package/.sdk/tm/dart/lib/feature/cache/CacheFeature.dart +152 -0
- package/.sdk/tm/dart/lib/feature/clienttrack/ClienttrackFeature.dart +104 -0
- package/.sdk/tm/dart/lib/feature/cost/CostFeature.dart +446 -0
- package/.sdk/tm/dart/lib/feature/debug/DebugFeature.dart +153 -0
- package/.sdk/tm/dart/lib/feature/idempotency/IdempotencyFeature.dart +92 -0
- package/.sdk/tm/dart/lib/feature/log/LogFeature.dart +85 -0
- package/.sdk/tm/dart/lib/feature/metrics/MetricsFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/netsim/NetsimFeature.dart +186 -0
- package/.sdk/tm/dart/lib/feature/paging/PagingFeature.dart +240 -0
- package/.sdk/tm/dart/lib/feature/proxy/ProxyFeature.dart +118 -0
- package/.sdk/tm/dart/lib/feature/ratelimit/RatelimitFeature.dart +103 -0
- package/.sdk/tm/dart/lib/feature/rbac/RbacFeature.dart +121 -0
- package/.sdk/tm/dart/lib/feature/retry/RetryFeature.dart +155 -0
- package/.sdk/tm/dart/lib/feature/secrets/SecretsFeature.dart +649 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/capability.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/catalog.dart +46 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/config.dart +297 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/depend.dart +198 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/env.dart +144 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/export.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/graph.dart +160 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/host.dart +1067 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/order.dart +172 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/plugin.dart +23 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/point.dart +117 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/ref.dart +105 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/resolve.dart +58 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/types.dart +201 -0
- package/.sdk/tm/dart/lib/feature/secrets/plugin/version.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/aws.dart +285 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/azuresecrets.dart +178 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/boru.dart +145 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/crypto.dart +194 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/doppler.dart +101 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/gcpsecrets.dart +143 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/hashicorp.dart +190 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/httpjson.dart +363 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/infisical.dart +149 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/onepassword.dart +146 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/secretspec.dart +116 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/plugins/sigv4.dart +237 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/addr.dart +138 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/json.dart +276 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/provider.dart +31 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/providers.dart +243 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/sekreto.dart +730 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/spec.dart +200 -0
- package/.sdk/tm/dart/lib/feature/secrets/sekreto/src/support.dart +217 -0
- package/.sdk/tm/dart/lib/feature/streaming/StreamingFeature.dart +97 -0
- package/.sdk/tm/dart/lib/feature/telemetry/TelemetryFeature.dart +136 -0
- package/.sdk/tm/dart/lib/feature/test/TestFeature.dart +328 -0
- package/.sdk/tm/dart/lib/feature/timeout/TimeoutFeature.dart +104 -0
- package/.sdk/tm/dart/lib/utility/CleanUtility.dart +12 -0
- package/.sdk/tm/dart/lib/utility/DoneUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ErrUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/FeatureAddUtility.dart +35 -0
- package/.sdk/tm/dart/lib/utility/FeatureHookUtility.dart +20 -0
- package/.sdk/tm/dart/lib/utility/FeatureInitUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/FetcherUtility.dart +104 -0
- package/.sdk/tm/dart/lib/utility/GraphqlUtility.dart +162 -0
- package/.sdk/tm/dart/lib/utility/MakeContextUtility.dart +6 -0
- package/.sdk/tm/dart/lib/utility/MakeErrorUtility.dart +71 -0
- package/.sdk/tm/dart/lib/utility/MakeFetchDefUtility.dart +42 -0
- package/.sdk/tm/dart/lib/utility/MakeOptionsUtility.dart +233 -0
- package/.sdk/tm/dart/lib/utility/MakePointUtility.dart +130 -0
- package/.sdk/tm/dart/lib/utility/MakeRequestUtility.dart +66 -0
- package/.sdk/tm/dart/lib/utility/MakeResponseUtility.dart +59 -0
- package/.sdk/tm/dart/lib/utility/MakeResultUtility.dart +49 -0
- package/.sdk/tm/dart/lib/utility/MakeSpecUtility.dart +77 -0
- package/.sdk/tm/dart/lib/utility/MakeUrlUtility.dart +51 -0
- package/.sdk/tm/dart/lib/utility/ParamUtility.dart +56 -0
- package/.sdk/tm/dart/lib/utility/PrepareAuthUtility.dart +46 -0
- package/.sdk/tm/dart/lib/utility/PrepareBodyUtility.dart +19 -0
- package/.sdk/tm/dart/lib/utility/PrepareHeadersUtility.dart +11 -0
- package/.sdk/tm/dart/lib/utility/PrepareMethodUtility.dart +30 -0
- package/.sdk/tm/dart/lib/utility/PrepareParamsUtility.dart +23 -0
- package/.sdk/tm/dart/lib/utility/PreparePathUtility.dart +9 -0
- package/.sdk/tm/dart/lib/utility/PrepareQueryUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/ResultBasicUtility.dart +29 -0
- package/.sdk/tm/dart/lib/utility/ResultBodyUtility.dart +15 -0
- package/.sdk/tm/dart/lib/utility/ResultHeadersUtility.dart +18 -0
- package/.sdk/tm/dart/lib/utility/StructUtility.dart +127 -0
- package/.sdk/tm/dart/lib/utility/TransformRequestUtility.dart +28 -0
- package/.sdk/tm/dart/lib/utility/TransformResponseUtility.dart +44 -0
- package/.sdk/tm/dart/lib/utility/Utility.dart +239 -0
- package/.sdk/tm/dart/lib/utility/voxgig_struct.dart +2462 -0
- package/.sdk/tm/dart/src/feature/README.md +3 -0
- package/.sdk/tm/dart/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/secrets/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/dart/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/dart/test/custom_test.dart +65 -0
- package/.sdk/tm/dart/test/exists_test.dart +12 -0
- package/.sdk/tm/dart/test/feature/harness.dart +347 -0
- package/.sdk/tm/dart/test/feature/secrets/secrets_test.dart +1107 -0
- package/.sdk/tm/dart/test/feature_test.dart +1193 -0
- package/.sdk/tm/dart/test/harness.dart +153 -0
- package/.sdk/tm/dart/test/netsim_test.dart +48 -0
- package/.sdk/tm/dart/test/omni.dart +520 -0
- package/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/.sdk/tm/dart/test/pipeline_test.dart +608 -0
- package/.sdk/tm/dart/test/primary_test.dart +476 -0
- package/.sdk/tm/dart/test/sdk-test-control.json +19 -0
- package/.sdk/tm/dart/test/struct_test.dart +468 -0
- package/.sdk/tm/dart/test/utility.dart +198 -0
- package/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/.sdk/tm/haskell/LICENSE +21 -0
- package/.sdk/tm/haskell/Makefile +22 -0
- package/.sdk/tm/haskell/VERSION +1 -0
- package/.sdk/tm/haskell/src/SdkFeatures.hs +1440 -0
- package/.sdk/tm/haskell/src/SdkHelpers.hs +337 -0
- package/.sdk/tm/haskell/src/SdkJson.hs +111 -0
- package/.sdk/tm/haskell/src/SdkRuntime.hs +1279 -0
- package/.sdk/tm/haskell/src/SdkTypes.hs +195 -0
- package/.sdk/tm/haskell/src/VoxgigStruct.hs +2299 -0
- package/.sdk/tm/haskell/src/Vregex.hs +237 -0
- package/.sdk/tm/haskell/src/feature/README.md +5 -0
- package/.sdk/tm/haskell/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/haskell/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/haskell/test/Harness.hs +281 -0
- package/.sdk/tm/haskell/test/OmniResolver.hs +252 -0
- package/.sdk/tm/haskell/test/Runner.hs +49 -0
- package/.sdk/tm/haskell/test/StructCorpus.hs +449 -0
- package/.sdk/tm/haskell/test/TCustomUtility.hs +38 -0
- package/.sdk/tm/haskell/test/TFeature.hs +794 -0
- package/.sdk/tm/haskell/test/TNetsim.hs +50 -0
- package/.sdk/tm/haskell/test/TPipeline.hs +334 -0
- package/.sdk/tm/haskell/test/TPrimaryCorpus.hs +263 -0
- package/.sdk/tm/haskell/test/TPrimaryUtility.hs +386 -0
- package/.sdk/tm/haskell/test/Testutil.hs +59 -0
- package/.sdk/tm/haskell/test/vendor/omni/Omni.hs +1147 -0
- package/.sdk/tm/lean/LICENSE +21 -0
- package/.sdk/tm/lean/Makefile +32 -0
- package/.sdk/tm/lean/VERSION +1 -0
- package/.sdk/tm/lean/src/SdkFeature.lean +171 -0
- package/.sdk/tm/lean/src/SdkFeatures.lean +787 -0
- package/.sdk/tm/lean/src/SdkJson.lean +134 -0
- package/.sdk/tm/lean/src/SdkRuntime.lean +374 -0
- package/.sdk/tm/lean/src/SdkUtility.lean +809 -0
- package/.sdk/tm/lean/src/VoxgigStruct.lean +2880 -0
- package/.sdk/tm/lean/src/Vregex.lean +412 -0
- package/.sdk/tm/lean/src/feature/README.md +5 -0
- package/.sdk/tm/lean/src/feature/audit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/base/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cache/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/clienttrack/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/cost/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/debug/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/idempotency/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/log/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/metrics/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/netsim/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/paging/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/proxy/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/ratelimit/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/rbac/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/retry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/streaming/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/telemetry/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/test/.gitkeep +0 -0
- package/.sdk/tm/lean/src/feature/timeout/.gitkeep +0 -0
- package/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/.sdk/tm/lean/test/StructCorpus.lean +368 -0
- package/.sdk/tm/lean/test/TFeature.lean +281 -0
- package/.sdk/tm/lean/test/TPrimaryUtility.lean +227 -0
- package/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/package.json +78 -0
- package/sdkgen-package.json +22 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
// The corpus test runner: vendored @voxgig/omni driven through its NATIVE
|
|
2
|
+
// API (`vendor/omni/omni.dart`'s `makeRunner(specref, provider)`), presented
|
|
3
|
+
// to the corpus tests in the struct-runner shape they already use
|
|
4
|
+
// (`run.spec`, `run.runset`, `run.runsetflags`, `run.client`). No compat
|
|
5
|
+
// shim is vendored: the adapter below IS the whole bridge, per language, per
|
|
6
|
+
// the vendor-tag rollout (docs/design/vendor-tag-rollout.md, Decision 4). It
|
|
7
|
+
// supersedes test/runner.dart (the fused engine) and test/struct_corpus.dart
|
|
8
|
+
// (the second, independent engine the struct corpus carried).
|
|
9
|
+
//
|
|
10
|
+
// Dart-specific decisions, each load-bearing:
|
|
11
|
+
//
|
|
12
|
+
// 1. THE SDK IS ASYNC AND OMNI IS NOT - the one thing that makes dart
|
|
13
|
+
// different from every other migrated target. `RunPack.runset` is `void`
|
|
14
|
+
// and calls `entrysubject(args)` synchronously; four generated utilities
|
|
15
|
+
// (fetcher, makeRequest, makeResponse, resultBody) answer `Future`, and
|
|
16
|
+
// three of them are corpus-driven. Dart has no way to block on a Future
|
|
17
|
+
// (dart:cli's waitFor was removed in Dart 3), so this resolver drives
|
|
18
|
+
// omni TWICE over the same set:
|
|
19
|
+
//
|
|
20
|
+
// PASS A (execute) runs a copy of the set with `out`/`err`/`match`
|
|
21
|
+
// stripped from every entry - so the null flag makes NULLMARK both the
|
|
22
|
+
// expectation and the (collector's) result, and every entry passes by
|
|
23
|
+
// construction. The real subject runs here, exactly once; its return
|
|
24
|
+
// value (Future or not) and any throw are captured, along with omni's
|
|
25
|
+
// own argument list.
|
|
26
|
+
//
|
|
27
|
+
// SETTLE awaits each captured Future, then writes each typed Context's
|
|
28
|
+
// observable state back into the ctx map it came from (decision 3).
|
|
29
|
+
//
|
|
30
|
+
// PASS B (verify) re-runs the REAL set with a replay subject that
|
|
31
|
+
// returns the settled value (or rethrows the settled error) and splices
|
|
32
|
+
// pass A's mutated argument containers into pass B's, keeping identity
|
|
33
|
+
// so `match: {args: ...}` and `match: {ctx: ...}` read post-run state.
|
|
34
|
+
//
|
|
35
|
+
// Every assertion - argument resolution, null normalisation, result
|
|
36
|
+
// comparison, error matching, `match` walking, failure text - is omni's.
|
|
37
|
+
// The passes differ only in which subject omni calls. Upstream follow-up:
|
|
38
|
+
// an async-capable dart runner (so pass A/B collapse into one).
|
|
39
|
+
//
|
|
40
|
+
// 2. OMNI DOES NOT NORMALISE CLASS INSTANCES; THE RETIRED RUNNER DID.
|
|
41
|
+
// omni's `fixjson` passes a non-Map/List value through untouched, and
|
|
42
|
+
// `deepequal`/`getpath` then see a typed object - so `primary.makeContext`
|
|
43
|
+
// asserting `match: {out: {op: {name: 'create'}}}` would read every leaf
|
|
44
|
+
// as absent. The useful half of the retired runner (its `jsonNorm`) lives
|
|
45
|
+
// on here as `_tojson`, the subject-result conversion: `toJSON()` for the
|
|
46
|
+
// pipeline value classes (Context, Spec, Result, Response, Operation,
|
|
47
|
+
// Point), {name,message,code} for error values, functions dropped, and a
|
|
48
|
+
// cycle guard.
|
|
49
|
+
//
|
|
50
|
+
// 3. CONTEXTS STAY MAPS ACROSS THE RUNNER. omni sets `entry['ctx']` to the
|
|
51
|
+
// contextified args[0] and `match: {ctx: ...}` reads THROUGH it with
|
|
52
|
+
// `getpath`, which walks Maps and Lists only. A typed Context there would
|
|
53
|
+
// make every ctx assertion read "absent". So the ctx stays an omni map;
|
|
54
|
+
// this resolver materialises the real Context from it at the subject
|
|
55
|
+
// boundary (as the retired runner did), and writes the Context's
|
|
56
|
+
// observable state back into that same map after the call. Call sites keep
|
|
57
|
+
// receiving a Context and need no change. (java's OmniResolver spells the
|
|
58
|
+
// same contract as per-call-site omniCtx/omniSyncCtx because its typed
|
|
59
|
+
// CtxFn cannot be built generically; dart's `makeContext` can.)
|
|
60
|
+
//
|
|
61
|
+
// 4. ZERO-ARGUMENT ENTRIES. The corpus carries entries with no `in`, `args`
|
|
62
|
+
// or `ctx`, meaning "call the subject with NO value" - struct's
|
|
63
|
+
// `minor/typify` has both `{in: null, out: <T_null>}` and
|
|
64
|
+
// `{out: <T_noval>}`. The vendored dart port distinguishes them natively
|
|
65
|
+
// (`args = [entry.containsKey('in') ? entry['in'] : ABSENT]`), so dart is
|
|
66
|
+
// the java shape: no novalargs spec rewrite, no compat shim. The
|
|
67
|
+
// resolver's ONE boundary conversion is the sentinel swap: omni's ABSENT
|
|
68
|
+
// becomes the dart struct port's own no-value sentinel
|
|
69
|
+
// (`voxgig_struct.pathifyNoArg`, the default of typify/stringify/pathify)
|
|
70
|
+
// on the way in. Sections that want dart's single `null` for a
|
|
71
|
+
// zero-argument entry (the port has no no-value overload for `isnode`,
|
|
72
|
+
// `clone`, `merge`, ...) map it back at their own call site - see
|
|
73
|
+
// struct_test.dart's `_plain`.
|
|
74
|
+
//
|
|
75
|
+
// 5. THE VENDORED DART PORT AT THIS TAG carries omni#54's match fix
|
|
76
|
+
// (`_match` reads its base directly, no clone - java and go still clone)
|
|
77
|
+
// but NOT the `jsonstr` cycle guard (util.dart has no seen-set). Both
|
|
78
|
+
// only bite on CYCLIC values, so java's decision-3 discipline applies
|
|
79
|
+
// verbatim: typed and potentially cyclic state (a live SDK, a Context)
|
|
80
|
+
// stays OUT of the entry maps - decisions 2 and 3 above are what keep it
|
|
81
|
+
// that way, and `_fail` excludes `ctx` from its entry summary. Recorded
|
|
82
|
+
// here for the next-tag resync, not patched locally.
|
|
83
|
+
//
|
|
84
|
+
// 6. NO subject-by-name provider hook. The dart SDK COULD serve one
|
|
85
|
+
// (`Utility.byName` / `StructUtility.byName` both answer `dynamic`), but
|
|
86
|
+
// omni consults it only to OVERRIDE an explicitly passed subject when an
|
|
87
|
+
// entry names a `client` - which would discard the per-section adapters
|
|
88
|
+
// the corpus call sites supply. Every call site passes its subject
|
|
89
|
+
// explicitly, so the hook is dead weight at best. DEF.client entries still
|
|
90
|
+
// resolve: the `client` hook below builds another live test SDK, and
|
|
91
|
+
// `_makectx` hands it to the Context as `ctx.client`.
|
|
92
|
+
|
|
93
|
+
import 'vendor/omni/omni.dart' as omni;
|
|
94
|
+
|
|
95
|
+
import 'utility.dart' show resolveTestPath;
|
|
96
|
+
|
|
97
|
+
import '../lib/utility/ErrUtility.dart';
|
|
98
|
+
import '../lib/utility/voxgig_struct.dart' as vs;
|
|
99
|
+
|
|
100
|
+
// The sentinels, under the names the corpus tests already use.
|
|
101
|
+
const String NULLMARK = omni.NULLMARK;
|
|
102
|
+
const String UNDEFMARK = omni.UNDEFMARK;
|
|
103
|
+
const String EXISTSMARK = omni.EXISTSMARK;
|
|
104
|
+
|
|
105
|
+
// omni's own types, re-exported so the corpus suites and the smoke test
|
|
106
|
+
// need not reach into the vendored directory themselves.
|
|
107
|
+
typedef Flags = omni.Flags;
|
|
108
|
+
typedef OmniError = omni.OmniError;
|
|
109
|
+
|
|
110
|
+
// Absence, as distinct from a JSON null (see decision 4).
|
|
111
|
+
const dynamic ABSENT = omni.ABSENT;
|
|
112
|
+
bool isabsent(dynamic val) => omni.isabsent(val);
|
|
113
|
+
|
|
114
|
+
/// Convert NULLMARK sentinels back into real nulls.
|
|
115
|
+
///
|
|
116
|
+
/// NOT a delegation to omni's `nullmodifier`, deliberately: omni's RETURNS
|
|
117
|
+
/// the replacement value, while the dart struct port's `inject` passes this
|
|
118
|
+
/// as its `modify` hook and expects it to MUTATE `parent[key]` in place.
|
|
119
|
+
void nullModifier(dynamic val, dynamic key, dynamic parent, [dynamic inj]) {
|
|
120
|
+
if (NULLMARK == val) {
|
|
121
|
+
vs.setprop(parent, key, null);
|
|
122
|
+
} else if (val is String) {
|
|
123
|
+
vs.setprop(parent, key, val.replaceAll(NULLMARK, 'null'));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/// What one subject call produced: the value (or the throw), omni's own
|
|
128
|
+
/// argument list, and the typed Context materialised for args[0], if any.
|
|
129
|
+
class _Capture {
|
|
130
|
+
final List<dynamic> args;
|
|
131
|
+
|
|
132
|
+
dynamic ctxmap;
|
|
133
|
+
dynamic ctx;
|
|
134
|
+
|
|
135
|
+
dynamic value;
|
|
136
|
+
bool threw = false;
|
|
137
|
+
Object error = '';
|
|
138
|
+
|
|
139
|
+
_Capture(this.args);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/// The live SDK, wrapped as an omni provider. One instance per makeRunner
|
|
143
|
+
/// call; DEF.client entries add more, each registered so `_makectx` can
|
|
144
|
+
/// resolve a ctx map's `client` back to the SDK it stands for.
|
|
145
|
+
class _Bridge {
|
|
146
|
+
final dynamic client;
|
|
147
|
+
|
|
148
|
+
// Providers built by a spec's DEF.client block - the only ones allowed to
|
|
149
|
+
// override a call site's own client. The BASE provider rides on every ctx
|
|
150
|
+
// entry, and letting it win would defeat the sections that deliberately
|
|
151
|
+
// construct a differently-optioned client (makeSpec, prepareAuth).
|
|
152
|
+
final Map<Object, dynamic> _live = Map.identity();
|
|
153
|
+
|
|
154
|
+
// Maps omni contextified for the set now running (decision 3).
|
|
155
|
+
final Set<Object> _marks = Set.identity();
|
|
156
|
+
|
|
157
|
+
late final omni.Provider provider;
|
|
158
|
+
|
|
159
|
+
_Bridge(this.client) {
|
|
160
|
+
provider = omni.Provider(
|
|
161
|
+
// A DEF.client entry becomes another live test SDK. `tester` takes the
|
|
162
|
+
// client options as TESTOPTS, which is where the retired runner put
|
|
163
|
+
// them; nothing in the shared corpus pins the choice (only
|
|
164
|
+
// `primary.check` declares a DEF.client, and dart does not drive it),
|
|
165
|
+
// so the existing behaviour is kept deliberately.
|
|
166
|
+
client: (dynamic options) {
|
|
167
|
+
final sub = _Bridge(client.tester(options ?? {}));
|
|
168
|
+
_live[sub.provider] = sub.client;
|
|
169
|
+
return sub.provider;
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
// Client options may reference the runner store.
|
|
173
|
+
inject: (dynamic options, dynamic store) {
|
|
174
|
+
vs.inject(options, store);
|
|
175
|
+
return options;
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
// The ctx STAYS an omni map (decision 3); mark it so the subject
|
|
179
|
+
// boundary knows to materialise a real Context from it.
|
|
180
|
+
contextify: (dynamic val) {
|
|
181
|
+
if (val is Map) {
|
|
182
|
+
_marks.add(val);
|
|
183
|
+
}
|
|
184
|
+
return val;
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
// Keep the SDK error's code beside its message, so a corpus
|
|
188
|
+
// `match: {err: {code: ...}}` can assert on it, and so the message is
|
|
189
|
+
// the SDK's own rather than Dart's `toString()` prefix. This is what
|
|
190
|
+
// the retired runner's jsonNorm put in the same slot.
|
|
191
|
+
errify: (dynamic err) {
|
|
192
|
+
final out = <String, dynamic>{
|
|
193
|
+
'name': err.runtimeType.toString(),
|
|
194
|
+
'message': errmsg(err),
|
|
195
|
+
};
|
|
196
|
+
final code = errcode(err);
|
|
197
|
+
if ('' != code) {
|
|
198
|
+
out['code'] = code;
|
|
199
|
+
}
|
|
200
|
+
return out;
|
|
201
|
+
},
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
void resetmarks() {
|
|
206
|
+
_marks.clear();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
bool isctx(dynamic val) => val is Map && _marks.contains(val);
|
|
210
|
+
|
|
211
|
+
/// Build the typed Context a generated utility takes from the ctx MAP omni
|
|
212
|
+
/// handed the subject. A DEF-built provider in the map's `client` slot
|
|
213
|
+
/// resolves back to the live SDK it wraps.
|
|
214
|
+
dynamic makectx(dynamic ctxmap) {
|
|
215
|
+
var sdk = client;
|
|
216
|
+
|
|
217
|
+
final found = ctxmap['client'];
|
|
218
|
+
if (found is omni.Provider) {
|
|
219
|
+
final live = _live[found];
|
|
220
|
+
if (null != live) {
|
|
221
|
+
sdk = live;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
final utility = sdk.utility();
|
|
226
|
+
final ctx = utility.makeContext(ctxmap);
|
|
227
|
+
ctx.client = sdk;
|
|
228
|
+
ctx.utility = utility;
|
|
229
|
+
return ctx;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/// What the runner returns for one named spec section - the struct-runner
|
|
234
|
+
/// shape the corpus call sites already consume. A failing entry throws
|
|
235
|
+
/// [OmniError] with the entry named, which fails the harness case.
|
|
236
|
+
class Run {
|
|
237
|
+
final dynamic spec;
|
|
238
|
+
|
|
239
|
+
/// The live SDK (NOT the omni provider): corpus suites call
|
|
240
|
+
/// `run.client.utility()` on it.
|
|
241
|
+
final dynamic client;
|
|
242
|
+
|
|
243
|
+
/// Entries actually driven through omni by this run. The corpus suites
|
|
244
|
+
/// assert on it: a suite that stopped executing the corpus would still be
|
|
245
|
+
/// green, and that is the failure mode this rollout exists to prevent.
|
|
246
|
+
int caseCount = 0;
|
|
247
|
+
|
|
248
|
+
final omni.RunPack _pack;
|
|
249
|
+
final _Bridge _bridge;
|
|
250
|
+
|
|
251
|
+
Run(this._pack, this._bridge)
|
|
252
|
+
: spec = _pack.spec,
|
|
253
|
+
client = _bridge.client;
|
|
254
|
+
|
|
255
|
+
/// A named group of the resolved spec.
|
|
256
|
+
dynamic set(String name) => _pack.set(name);
|
|
257
|
+
|
|
258
|
+
/// Run one set of test entries with omni's default flags.
|
|
259
|
+
Future<void> runset(dynamic testspec, [dynamic subject]) =>
|
|
260
|
+
runsetflags(testspec, const omni.Flags(), subject);
|
|
261
|
+
|
|
262
|
+
/// Run one set of test entries with explicit flags (see decision 1 for why
|
|
263
|
+
/// this drives omni twice).
|
|
264
|
+
Future<void> runsetflags(dynamic testspec, omni.Flags flags,
|
|
265
|
+
[dynamic subject]) async {
|
|
266
|
+
if (null == subject) {
|
|
267
|
+
throw omni.OmniError('omni: no test subject supplied');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
final caps = <_Capture>[];
|
|
271
|
+
|
|
272
|
+
// PASS A: execute. Checks are stripped, so every entry passes and the
|
|
273
|
+
// real subject runs exactly once, for its value or its throw.
|
|
274
|
+
_bridge.resetmarks();
|
|
275
|
+
_pack.runsetflags(_stripchecks(testspec), flags, (List<dynamic> args) {
|
|
276
|
+
caps.add(_call(subject, args));
|
|
277
|
+
return null;
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
// SETTLE: await what the SDK deferred, then publish each Context's
|
|
281
|
+
// observable state into the ctx map `match: {ctx: ...}` reads.
|
|
282
|
+
for (final cap in caps) {
|
|
283
|
+
final pending = cap.value;
|
|
284
|
+
if (pending is Future) {
|
|
285
|
+
try {
|
|
286
|
+
cap.value = await pending;
|
|
287
|
+
} catch (err) {
|
|
288
|
+
cap.threw = true;
|
|
289
|
+
cap.error = err;
|
|
290
|
+
cap.value = null;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (null != cap.ctx) {
|
|
294
|
+
_syncctx(cap.ctxmap, cap.ctx);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
caseCount += caps.length;
|
|
299
|
+
|
|
300
|
+
// PASS B: verify. omni re-runs the REAL set; the replay subject supplies
|
|
301
|
+
// the settled outcome and the mutated arguments.
|
|
302
|
+
var at = 0;
|
|
303
|
+
_pack.runsetflags(testspec, flags, (List<dynamic> args) {
|
|
304
|
+
if (at >= caps.length) {
|
|
305
|
+
throw omni.OmniError(
|
|
306
|
+
'omni: replay ran out of captured results (verify pass drove more '
|
|
307
|
+
'entries than the execute pass)');
|
|
308
|
+
}
|
|
309
|
+
final cap = caps[at++];
|
|
310
|
+
_replayargs(args, cap.args);
|
|
311
|
+
if (cap.threw) {
|
|
312
|
+
throw cap.error;
|
|
313
|
+
}
|
|
314
|
+
return _tojson(cap.value);
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Call the subject for one entry, capturing everything pass B needs.
|
|
319
|
+
_Capture _call(dynamic subject, List<dynamic> args) {
|
|
320
|
+
final cap = _Capture(args);
|
|
321
|
+
|
|
322
|
+
final callargs = <dynamic>[];
|
|
323
|
+
for (final arg in args) {
|
|
324
|
+
// Decision 4: omni's absence becomes the port's own no-value.
|
|
325
|
+
callargs.add(omni.isabsent(arg) ? vs.pathifyNoArg : arg);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Decision 3: the entry's ctx/args map becomes a real Context here.
|
|
329
|
+
if (callargs.isNotEmpty && _bridge.isctx(args[0])) {
|
|
330
|
+
cap.ctxmap = args[0];
|
|
331
|
+
cap.ctx = _bridge.makectx(cap.ctxmap);
|
|
332
|
+
callargs[0] = cap.ctx;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
try {
|
|
336
|
+
cap.value = Function.apply(subject, callargs);
|
|
337
|
+
} catch (err) {
|
|
338
|
+
cap.threw = true;
|
|
339
|
+
cap.error = err;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return cap;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/// The struct runner's `makeRunner(testfile, client)` signature, backed by
|
|
347
|
+
/// vendored omni. `testfile` is a spec path (resolved against the package
|
|
348
|
+
/// root or the test directory - omni's loader does not resolve relative
|
|
349
|
+
/// paths itself) or an already-parsed spec value (omni's own capability),
|
|
350
|
+
/// which keeps the smoke test free of fixture files.
|
|
351
|
+
Run Function(String name, [dynamic store]) makeRunner(
|
|
352
|
+
dynamic testfile, dynamic client) {
|
|
353
|
+
final specref = testfile is String ? resolveTestPath(testfile) : testfile;
|
|
354
|
+
|
|
355
|
+
final bridge = _Bridge(client);
|
|
356
|
+
final runner = omni.makeRunner(specref, bridge.provider);
|
|
357
|
+
|
|
358
|
+
return (String name, [dynamic store]) =>
|
|
359
|
+
Run(runner.runner(name, store), bridge);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// ---------------------------------------------------------------------------
|
|
363
|
+
// Pass plumbing
|
|
364
|
+
// ---------------------------------------------------------------------------
|
|
365
|
+
|
|
366
|
+
// A copy of the set with every entry's checks removed, so pass A cannot
|
|
367
|
+
// fail: with no `out` the null flag makes NULLMARK the expectation, and the
|
|
368
|
+
// collector returns null, which fixjson turns into exactly that. `empty` and
|
|
369
|
+
// every other group-level key survive, so a malformed group still fails in
|
|
370
|
+
// pass A with omni's own message.
|
|
371
|
+
dynamic _stripchecks(dynamic testspec) {
|
|
372
|
+
if (testspec is! Map) {
|
|
373
|
+
return testspec;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
final out = <String, dynamic>{};
|
|
377
|
+
testspec.forEach((key, val) => out['$key'] = val);
|
|
378
|
+
|
|
379
|
+
final testset = testspec['set'];
|
|
380
|
+
if (testset is List) {
|
|
381
|
+
out['set'] = testset.map<dynamic>((entry) {
|
|
382
|
+
if (entry is! Map) {
|
|
383
|
+
return entry;
|
|
384
|
+
}
|
|
385
|
+
final stripped = <String, dynamic>{};
|
|
386
|
+
entry.forEach((key, val) {
|
|
387
|
+
if ('out' != key && 'err' != key && 'match' != key) {
|
|
388
|
+
stripped['$key'] = val;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
return stripped;
|
|
392
|
+
}).toList();
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return out;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Write the OBSERVABLE state of a typed context back into the ctx map the
|
|
399
|
+
// entry holds, which is where a `match: {ctx: ...}` assertion reads. Exactly
|
|
400
|
+
// what the retired runner produced: it put the Context itself in `entry.ctx`
|
|
401
|
+
// and normalised the whole match base through jsonNorm, so the assertions
|
|
402
|
+
// have always read `Context.toJSON()`.
|
|
403
|
+
void _syncctx(dynamic ctxmap, dynamic ctx) {
|
|
404
|
+
if (ctxmap is! Map) {
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
final norm = _tojson(ctx);
|
|
409
|
+
if (norm is! Map) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
ctxmap.clear();
|
|
414
|
+
norm.forEach((key, val) => ctxmap[key] = val);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// Carry pass A's argument mutations into pass B's argument list. Containers
|
|
418
|
+
// are spliced (contents replaced, identity kept) because omni already handed
|
|
419
|
+
// the same object to `entry['ctx']` and to the `match` base; anything else is
|
|
420
|
+
// assigned. Without this, a subject that mutates its argument - struct's
|
|
421
|
+
// setpath and merge, and every ctx-carrying utility - would look inert.
|
|
422
|
+
void _replayargs(List<dynamic> into, List<dynamic> from) {
|
|
423
|
+
final count = into.length < from.length ? into.length : from.length;
|
|
424
|
+
|
|
425
|
+
for (var index = 0; index < count; index++) {
|
|
426
|
+
final target = into[index];
|
|
427
|
+
final source = from[index];
|
|
428
|
+
|
|
429
|
+
if (identical(target, source)) {
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
if (target is Map && source is Map) {
|
|
434
|
+
target.clear();
|
|
435
|
+
source.forEach((key, val) => target[key] = val);
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
if (target is List && source is List) {
|
|
440
|
+
target.clear();
|
|
441
|
+
target.addAll(source);
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
into[index] = source;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// Normalise a value to a JSON-like structure (decision 2): class instances
|
|
450
|
+
// through toJSON(), error values to {name, message, code}, functions dropped
|
|
451
|
+
// (map members) or nulled, cycles marked. Nulls are left alone - omni's own
|
|
452
|
+
// fixjson applies the null flag right after this.
|
|
453
|
+
dynamic _tojson(dynamic val, [Set<dynamic>? seen]) {
|
|
454
|
+
if (null == val || val is num || val is bool || val is String) {
|
|
455
|
+
return val;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// omni's own absence marker is a runner value, not a subject result: it
|
|
459
|
+
// must reach fixjson intact or an absent stays as the text "ABSENT".
|
|
460
|
+
if (omni.isabsent(val)) {
|
|
461
|
+
return val;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
seen ??= Set.identity();
|
|
465
|
+
|
|
466
|
+
if (val is Map) {
|
|
467
|
+
if (seen.contains(val)) {
|
|
468
|
+
return '[Circular]';
|
|
469
|
+
}
|
|
470
|
+
seen.add(val);
|
|
471
|
+
final out = <String, dynamic>{};
|
|
472
|
+
val.forEach((key, subval) {
|
|
473
|
+
if (subval is! Function) {
|
|
474
|
+
out['$key'] = _tojson(subval, seen);
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
seen.remove(val);
|
|
478
|
+
return out;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if (val is List) {
|
|
482
|
+
if (seen.contains(val)) {
|
|
483
|
+
return '[Circular]';
|
|
484
|
+
}
|
|
485
|
+
seen.add(val);
|
|
486
|
+
final out = val.map<dynamic>((subval) => _tojson(subval, seen)).toList();
|
|
487
|
+
seen.remove(val);
|
|
488
|
+
return out;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (iserr(val)) {
|
|
492
|
+
final out = <String, dynamic>{
|
|
493
|
+
'name': val.runtimeType.toString(),
|
|
494
|
+
'message': errmsg(val),
|
|
495
|
+
};
|
|
496
|
+
final code = errcode(val);
|
|
497
|
+
if ('' != code) {
|
|
498
|
+
out['code'] = code;
|
|
499
|
+
}
|
|
500
|
+
return out;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (val is Function) {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if (seen.contains(val)) {
|
|
508
|
+
return '[Circular]';
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
try {
|
|
512
|
+
seen.add(val);
|
|
513
|
+
final out = _tojson((val as dynamic).toJSON(), seen);
|
|
514
|
+
seen.remove(val);
|
|
515
|
+
return out;
|
|
516
|
+
} catch (_e) {
|
|
517
|
+
seen.remove(val);
|
|
518
|
+
return val.toString();
|
|
519
|
+
}
|
|
520
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Smoke tests for the vendored omni runner itself: a runner that cannot FAIL
|
|
2
|
+
// a bad entry would turn every corpus suite vacuously green, so pin the
|
|
3
|
+
// failure paths, not just the happy one. (The dart peer of tm/ts/test/
|
|
4
|
+
// omni.test.ts, tm/lua/test/omni_smoke_test.lua and tm/go/test/
|
|
5
|
+
// omnismoke_test.go.)
|
|
6
|
+
//
|
|
7
|
+
// The dart lane pins one thing the other targets need not: the resolver's
|
|
8
|
+
// two-pass drive (test/omni.dart, decision 1). An ASYNC subject must be
|
|
9
|
+
// driven to the same verdict as a sync one - passing when it settles to the
|
|
10
|
+
// expected value, FAILING when it does not, and matching an expected error
|
|
11
|
+
// when the Future rejects. Without those three, the async sections of the
|
|
12
|
+
// primary corpus could quietly stop asserting anything.
|
|
13
|
+
|
|
14
|
+
import 'harness.dart';
|
|
15
|
+
import 'omni.dart';
|
|
16
|
+
|
|
17
|
+
import '../lib/ProjectNameSDK.dart';
|
|
18
|
+
|
|
19
|
+
// A minimal in-memory spec: no fixture file, no OMNI block (lenient v0, like
|
|
20
|
+
// the shared corpus).
|
|
21
|
+
dynamic _makespec() => {
|
|
22
|
+
'primary': {
|
|
23
|
+
'smoke': {
|
|
24
|
+
'basic': {
|
|
25
|
+
'set': [
|
|
26
|
+
{'in': 1, 'out': 2},
|
|
27
|
+
{'in': 41, 'out': 42},
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
'bad': {
|
|
31
|
+
'set': [
|
|
32
|
+
{'in': 1, 'out': 999},
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
'err': {
|
|
36
|
+
'set': [
|
|
37
|
+
{'in': 0, 'err': 'zero refused'},
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
'ctx': {
|
|
41
|
+
'set': [
|
|
42
|
+
{
|
|
43
|
+
'ctx': {'opname': 'create'},
|
|
44
|
+
'match': {
|
|
45
|
+
'ctx': {
|
|
46
|
+
'op': {'name': 'create', 'input': 'data'}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
dynamic _inc(dynamic n) {
|
|
57
|
+
if (0 == n) {
|
|
58
|
+
throw Exception('smoke: zero refused');
|
|
59
|
+
}
|
|
60
|
+
return n + 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Future<dynamic> _incAsync(dynamic n) async {
|
|
64
|
+
await Future<void>.delayed(Duration.zero);
|
|
65
|
+
return _inc(n);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Run _pack() {
|
|
69
|
+
final runner = makeRunner(_makespec(), ProjectNameSDK.test());
|
|
70
|
+
return runner('smoke');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Run `body`, requiring it to raise an omni failure whose message contains
|
|
74
|
+
// `want`.
|
|
75
|
+
Future<void> _mustfail(Future<void> Function() body, String want) async {
|
|
76
|
+
var raised = false;
|
|
77
|
+
try {
|
|
78
|
+
await body();
|
|
79
|
+
} on OmniError catch (err) {
|
|
80
|
+
raised = true;
|
|
81
|
+
ok(err.toString().contains(want),
|
|
82
|
+
'expected a failure containing "' + want + '", got: ' + err.toString());
|
|
83
|
+
}
|
|
84
|
+
ok(raised, 'expected the runner to FAIL, but it passed');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
void tests() {
|
|
88
|
+
describe('omni', () {
|
|
89
|
+
|
|
90
|
+
test('runset passes a correct subject', (t) async {
|
|
91
|
+
final run = _pack();
|
|
92
|
+
await run.runset(run.spec['basic'], _inc);
|
|
93
|
+
equal(2, run.caseCount, 'both smoke entries must be driven');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('runset fails a wrong result', (t) async {
|
|
97
|
+
final run = _pack();
|
|
98
|
+
await _mustfail(
|
|
99
|
+
() => run.runset(run.spec['bad'], _inc), 'result mismatch');
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('an expected error is matched, a missing one fails', (t) async {
|
|
103
|
+
final run = _pack();
|
|
104
|
+
await run.runset(run.spec['err'], _inc);
|
|
105
|
+
|
|
106
|
+
final run2 = _pack();
|
|
107
|
+
await _mustfail(() => run2.runset(run2.spec['err'], (dynamic n) => n),
|
|
108
|
+
'expected error did not occur');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// The two-pass drive (omni.dart decision 1): the same verdicts must hold
|
|
112
|
+
// when the subject answers a Future.
|
|
113
|
+
test('an async subject passes, fails and errors alike', (t) async {
|
|
114
|
+
final run = _pack();
|
|
115
|
+
await run.runset(run.spec['basic'], _incAsync);
|
|
116
|
+
equal(2, run.caseCount, 'both smoke entries must be driven');
|
|
117
|
+
|
|
118
|
+
final run2 = _pack();
|
|
119
|
+
await _mustfail(
|
|
120
|
+
() => run2.runset(run2.spec['bad'], _incAsync), 'result mismatch');
|
|
121
|
+
|
|
122
|
+
final run3 = _pack();
|
|
123
|
+
await run3.runset(run3.spec['err'], _incAsync);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// A ctx entry must reach the subject as a real Context, and its post-run
|
|
127
|
+
// state must be visible to `match: {ctx: ...}` (decision 3).
|
|
128
|
+
test('a ctx entry is materialised and read back', (t) async {
|
|
129
|
+
final run = _pack();
|
|
130
|
+
await run.runset(run.spec['ctx'], (dynamic ctx) {
|
|
131
|
+
ok(null != ctx.op, 'ctx must arrive as a real Context');
|
|
132
|
+
return null;
|
|
133
|
+
});
|
|
134
|
+
equal(1, run.caseCount);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
test('a subject that never runs is reported', (t) async {
|
|
138
|
+
final run = _pack();
|
|
139
|
+
await _mustfail(() => run.runset(run.spec['basic']), 'no test subject');
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
});
|
|
143
|
+
}
|