@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,653 @@
|
|
|
1
|
+
// VENDORED: @voxgig/omni sdk-20260908-1556-0 (dart/lib/runner.dart)
|
|
2
|
+
// Source: https://github.com/voxgig/omni @ 274708cc2d12b21707d975543953f845f8444be0 [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// Omni: the shared multi-language test runner (Dart port).
|
|
5
|
+
//
|
|
6
|
+
// Port of the canonical TypeScript implementation
|
|
7
|
+
// (typescript/src/Runner.ts). Behaviour must match, case for case.
|
|
8
|
+
|
|
9
|
+
import 'dart:convert';
|
|
10
|
+
import 'dart:io';
|
|
11
|
+
|
|
12
|
+
import 'util.dart';
|
|
13
|
+
|
|
14
|
+
/// The function under test. Arguments arrive as JSON values; failure is
|
|
15
|
+
/// reported by throwing.
|
|
16
|
+
typedef Subject = dynamic Function(List<dynamic> args);
|
|
17
|
+
|
|
18
|
+
/// A test failure (or a malformed spec). Distinct from an exception thrown
|
|
19
|
+
/// by the subject under test, which is a candidate for an `err`
|
|
20
|
+
/// expectation.
|
|
21
|
+
class OmniError implements Exception {
|
|
22
|
+
final String message;
|
|
23
|
+
final dynamic entry;
|
|
24
|
+
|
|
25
|
+
OmniError(this.message, [this.entry]);
|
|
26
|
+
|
|
27
|
+
@override
|
|
28
|
+
String toString() => message;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// Run-time options for a set of test entries.
|
|
32
|
+
class Flags {
|
|
33
|
+
final bool nulls;
|
|
34
|
+
final String? name;
|
|
35
|
+
|
|
36
|
+
const Flags({this.nulls = true, this.name});
|
|
37
|
+
|
|
38
|
+
static const Flags nonull = Flags(nulls: false);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/// The host of the system under test. Every hook is optional.
|
|
42
|
+
class Provider {
|
|
43
|
+
final Subject? Function(String name)? subject;
|
|
44
|
+
final Provider Function(dynamic options)? client;
|
|
45
|
+
final dynamic Function(dynamic val)? contextify;
|
|
46
|
+
final dynamic Function(dynamic options, dynamic store)? inject;
|
|
47
|
+
|
|
48
|
+
/// Build the `match.err` base from the raised error, REPLACING [errify].
|
|
49
|
+
/// A library whose errors carry a code can then assert on it with
|
|
50
|
+
/// `match: {err: {code: 'x'}}` instead of pattern-matching prose.
|
|
51
|
+
final dynamic Function(dynamic err)? errify;
|
|
52
|
+
|
|
53
|
+
const Provider({
|
|
54
|
+
this.subject,
|
|
55
|
+
this.client,
|
|
56
|
+
this.contextify,
|
|
57
|
+
this.inject,
|
|
58
|
+
this.errify,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// The newest spec format version this runner understands. A spec with no
|
|
63
|
+
/// OMNI block is version 0: the original, lenient format, frozen forever.
|
|
64
|
+
/// Version 1 turns on strict entry validation (see _checkentry).
|
|
65
|
+
const int SPECVERSION = 1;
|
|
66
|
+
|
|
67
|
+
/// Capability strings this runner supports beyond the version baseline. A
|
|
68
|
+
/// spec's OMNI.requires list is checked against this: an unknown capability
|
|
69
|
+
/// refuses the spec loudly at load time, instead of a lagging port silently
|
|
70
|
+
/// mis-running it. (Empty today; future format features mint a string here.)
|
|
71
|
+
const List<String> CAPABILITIES = [];
|
|
72
|
+
|
|
73
|
+
/// The complete set of fields an entry may carry. Under version 1 anything
|
|
74
|
+
/// else is an error: an unrecognised key is almost always a typo'd
|
|
75
|
+
/// assertion, and a typo'd assertion is a test that silently stopped
|
|
76
|
+
/// testing.
|
|
77
|
+
const List<String> _entryfields = [
|
|
78
|
+
'in', 'args', 'ctx', 'out', 'err', 'match', 'client', 'id', 'doc',
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
/// Load a spec: a path to a JSON file.
|
|
82
|
+
dynamic loadspec(String path) {
|
|
83
|
+
final file = File(path);
|
|
84
|
+
if (!file.existsSync()) {
|
|
85
|
+
throw OmniError('omni: cannot read spec: $path');
|
|
86
|
+
}
|
|
87
|
+
return jsonDecode(file.readAsStringSync());
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/// Read the spec's format version from its optional top-level OMNI block,
|
|
91
|
+
/// and refuse a spec this runner cannot faithfully run: a version newer
|
|
92
|
+
/// than SPECVERSION, or a required capability not in CAPABILITIES. Only a
|
|
93
|
+
/// genuinely absent OMNI key is legacy - a present `OMNI: null` is
|
|
94
|
+
/// malformed, not version 0.
|
|
95
|
+
int _resolveversion(dynamic alltests) {
|
|
96
|
+
if (alltests is! Map || !alltests.containsKey('OMNI')) {
|
|
97
|
+
return 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
final meta = alltests['OMNI'];
|
|
101
|
+
final version = meta is Map ? meta['version'] : null;
|
|
102
|
+
|
|
103
|
+
var versionisint = false;
|
|
104
|
+
if (isnum(version)) {
|
|
105
|
+
final asnum = version as num;
|
|
106
|
+
versionisint = asnum.toDouble() == asnum.toDouble().truncateToDouble();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (meta is! Map || !versionisint) {
|
|
110
|
+
throw OmniError('omni: malformed OMNI version block');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
final versionval = (version as num).toInt();
|
|
114
|
+
if (0 > versionval || SPECVERSION < versionval) {
|
|
115
|
+
throw OmniError('omni: unsupported spec version: $versionval');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// A present `requires: null` is malformed, same as the OMNI block itself -
|
|
119
|
+
// only a genuinely absent key skips the check.
|
|
120
|
+
if (meta.containsKey('requires')) {
|
|
121
|
+
final requires = meta['requires'];
|
|
122
|
+
if (requires is! List) {
|
|
123
|
+
throw OmniError('omni: malformed OMNI requires list');
|
|
124
|
+
}
|
|
125
|
+
for (final cap in requires) {
|
|
126
|
+
if (cap is! String || !CAPABILITIES.contains(cap)) {
|
|
127
|
+
throw OmniError('omni: spec requires unsupported capability: ${stringify(cap)}');
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return versionval;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/// Find `primary.<name>`, then `<name>`, then the whole spec.
|
|
136
|
+
dynamic resolvespec(String name, dynamic alltests) {
|
|
137
|
+
if (name.isEmpty) {
|
|
138
|
+
return alltests;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (alltests is Map) {
|
|
142
|
+
final primary = alltests['primary'];
|
|
143
|
+
if (primary is Map && null != primary[name]) {
|
|
144
|
+
return primary[name];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (null != alltests[name]) {
|
|
148
|
+
return alltests[name];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return alltests;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/// Nulls become NULLMARK. Always a fresh copy.
|
|
156
|
+
dynamic fixjson(dynamic val, bool donull) {
|
|
157
|
+
if (null == val || isabsent(val)) {
|
|
158
|
+
// Canonical returns the value UNCHANGED when donull is false
|
|
159
|
+
// (typescript/src/Runner.ts): absent stays absent and null stays null.
|
|
160
|
+
// Answering null for both collapsed two states the corpus distinguishes.
|
|
161
|
+
// Same defect omni-lua and omni-rust carried (voxgig/omni#17, #23).
|
|
162
|
+
return donull ? NULLMARK : val;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (val is List) {
|
|
166
|
+
return val.map<dynamic>((entry) => fixjson(entry, donull)).toList();
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (val is Map) {
|
|
170
|
+
final out = <String, dynamic>{};
|
|
171
|
+
val.forEach((key, subval) => out['$key'] = fixjson(subval, donull));
|
|
172
|
+
return out;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return val;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/// The JSON form of an error: always at least {name,message}.
|
|
179
|
+
Map<String, dynamic> errify(dynamic err) {
|
|
180
|
+
if (err is OmniError) {
|
|
181
|
+
return {'name': 'OmniError', 'message': err.message};
|
|
182
|
+
}
|
|
183
|
+
return {'name': err.runtimeType.toString(), 'message': errmessage(err)};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
String errmessage(dynamic err) {
|
|
187
|
+
if (err is OmniError) {
|
|
188
|
+
return err.message;
|
|
189
|
+
}
|
|
190
|
+
if (err is ArgumentError) {
|
|
191
|
+
return '${err.message}';
|
|
192
|
+
}
|
|
193
|
+
if (err is Exception) {
|
|
194
|
+
final text = err.toString();
|
|
195
|
+
// Dart prefixes its built-in exceptions; the spec matches on messages.
|
|
196
|
+
return text.startsWith('Exception: ') ? text.substring(11) : text;
|
|
197
|
+
}
|
|
198
|
+
return '$err';
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/// Convert NULLMARK sentinels back into real nulls.
|
|
202
|
+
dynamic nullmodifier(dynamic val, List<String> path) {
|
|
203
|
+
if (val is String) {
|
|
204
|
+
return NULLMARK == val ? null : val.replaceAll(NULLMARK, 'null');
|
|
205
|
+
}
|
|
206
|
+
return val;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/// Match one leaf: /regex/ or case-insensitive substring for strings.
|
|
210
|
+
bool matchval(dynamic check, dynamic base) {
|
|
211
|
+
if (deepequal(check, base)) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
dynamic want = check;
|
|
216
|
+
if (UNDEFMARK == want || NULLMARK == want) {
|
|
217
|
+
want = null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (null == want) {
|
|
221
|
+
return null == base || isabsent(base) || NULLMARK == base;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (want is String) {
|
|
225
|
+
// An empty want is not a wildcard: it matches only an empty string.
|
|
226
|
+
if (want.isEmpty) {
|
|
227
|
+
return '' == base;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
final basestr = stringify(base);
|
|
231
|
+
|
|
232
|
+
if (2 < want.length && want.startsWith('/') && want.endsWith('/')) {
|
|
233
|
+
try {
|
|
234
|
+
return RegExp(want.substring(1, want.length - 1)).hasMatch(basestr);
|
|
235
|
+
} on FormatException {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return basestr.toLowerCase().contains(want.toLowerCase());
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return deepequal(want, base);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/// What a runner returns for one named spec section.
|
|
247
|
+
class RunPack {
|
|
248
|
+
final dynamic spec;
|
|
249
|
+
final Subject? subject;
|
|
250
|
+
final Provider client;
|
|
251
|
+
|
|
252
|
+
final Provider _provider;
|
|
253
|
+
final Map<String, Provider> _clients;
|
|
254
|
+
final String _name;
|
|
255
|
+
final int _specversion;
|
|
256
|
+
|
|
257
|
+
RunPack(this.spec, this.subject, this._provider, this._clients, this._name,
|
|
258
|
+
this._specversion)
|
|
259
|
+
: client = _provider;
|
|
260
|
+
|
|
261
|
+
/// A named group of the resolved spec.
|
|
262
|
+
dynamic set(String name) => spec is Map ? spec[name] : null;
|
|
263
|
+
|
|
264
|
+
/// Run one set of test entries.
|
|
265
|
+
void runset(dynamic testspec, [Subject? testsubject]) {
|
|
266
|
+
runsetflags(testspec, const Flags(), testsubject);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/// Run one set of test entries with flags.
|
|
270
|
+
void runsetflags(dynamic testspec, Flags flags, [Subject? testsubject]) {
|
|
271
|
+
final label = flags.name ?? (_name.isEmpty ? 'set' : _name);
|
|
272
|
+
|
|
273
|
+
final usesubject = testsubject ?? subject;
|
|
274
|
+
if (null == usesubject) {
|
|
275
|
+
throw OmniError('omni: no test subject for: $label');
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
final testspecmap = fixjson(testspec, flags.nulls);
|
|
279
|
+
if (testspecmap is! Map || testspecmap['set'] is! List) {
|
|
280
|
+
throw OmniError('omni: test spec has no set: $label');
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
final testset = testspecmap['set'] as List;
|
|
284
|
+
|
|
285
|
+
// Validate the AUTHORED group up front, against the un-normalised
|
|
286
|
+
// entries: null-normalisation above would otherwise rewrite an
|
|
287
|
+
// authored null (e.g. id: null) into a sentinel string and hide it
|
|
288
|
+
// from validation. A malformed spec is a spec error, not a test
|
|
289
|
+
// result, so it fails before any subject runs.
|
|
290
|
+
if (1 <= _specversion) {
|
|
291
|
+
_checkset(label, testspec, testset);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
for (var index = 0; index < testset.length; index++) {
|
|
295
|
+
final entry = testset[index];
|
|
296
|
+
|
|
297
|
+
if (entry is! Map) {
|
|
298
|
+
throw OmniError('omni: $label[$index]: entry is not a map');
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// An entry with no `out` expects a null (or absent) result.
|
|
302
|
+
if (flags.nulls && null == entry['out']) {
|
|
303
|
+
entry['out'] = NULLMARK;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
var entrysubject = usesubject;
|
|
307
|
+
var entryclient = _provider;
|
|
308
|
+
|
|
309
|
+
final clientname = entry['client'];
|
|
310
|
+
if (clientname is String) {
|
|
311
|
+
final found = _clients[clientname];
|
|
312
|
+
if (null == found) {
|
|
313
|
+
throw OmniError('omni: unknown client: $clientname', entry);
|
|
314
|
+
}
|
|
315
|
+
entryclient = found;
|
|
316
|
+
final clientsubject = found.subject?.call(_name);
|
|
317
|
+
if (null != clientsubject) {
|
|
318
|
+
entrysubject = clientsubject;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
final args = _resolveargs(entry, entryclient);
|
|
323
|
+
|
|
324
|
+
dynamic res;
|
|
325
|
+
try {
|
|
326
|
+
res = entrysubject(args);
|
|
327
|
+
} on OmniError {
|
|
328
|
+
rethrow;
|
|
329
|
+
} catch (err) {
|
|
330
|
+
_handleerror(label, index, entry, err);
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
res = fixjson(res, flags.nulls);
|
|
335
|
+
entry['res'] = res;
|
|
336
|
+
|
|
337
|
+
_checkresult(label, index, entry, args, res);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Validate a version-1 group up front, against the AUTHORED entries -
|
|
342
|
+
// `normalset` (post-fixjson) is only the fallback for a group whose
|
|
343
|
+
// original has no usable set.
|
|
344
|
+
void _checkset(String label, dynamic testspec, List normalset) {
|
|
345
|
+
final origset = (testspec is Map && testspec['set'] is List)
|
|
346
|
+
? testspec['set'] as List
|
|
347
|
+
: normalset;
|
|
348
|
+
|
|
349
|
+
final markedempty = testspec is Map && true == testspec['empty'];
|
|
350
|
+
if (origset.isEmpty && !markedempty) {
|
|
351
|
+
throw OmniError('omni: empty test set: $label');
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
for (var index = 0; index < origset.length; index++) {
|
|
355
|
+
_checkentry(label, index, origset[index]);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Strict entry validation, applied when the spec declares version 1 or
|
|
360
|
+
// later. The lenient format converts each of these mistakes into a
|
|
361
|
+
// silent pass or a dead field; here they fail with the entry named.
|
|
362
|
+
void _checkentry(String label, int index, dynamic entry) {
|
|
363
|
+
if (entry is! Map) {
|
|
364
|
+
throw _fail(label, index, entry, 'entry is not a map');
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
for (final key in entry.keys) {
|
|
368
|
+
final keystr = '$key';
|
|
369
|
+
if (!_entryfields.contains(keystr)) {
|
|
370
|
+
throw _fail(label, index, entry, 'unknown entry field: $keystr');
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
var argsources = 0;
|
|
375
|
+
for (final key in ['in', 'args', 'ctx']) {
|
|
376
|
+
if (entry.containsKey(key)) {
|
|
377
|
+
argsources++;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (1 < argsources) {
|
|
381
|
+
throw _fail(label, index, entry, 'entry has more than one of in, args, ctx');
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (null != entry['err'] && entry.containsKey('out')) {
|
|
385
|
+
throw _fail(label, index, entry, 'entry has both err and out');
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Presence, not definedness: an authored `id: null` must fail, while
|
|
389
|
+
// an absent id is simply unset.
|
|
390
|
+
if (entry.containsKey('id') && entry['id'] is! String) {
|
|
391
|
+
throw _fail(label, index, entry, 'entry id is not a string');
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// Build the argument list: `ctx`, `args`, or `in`.
|
|
396
|
+
List<dynamic> _resolveargs(Map entry, Provider client) {
|
|
397
|
+
List<dynamic> args;
|
|
398
|
+
|
|
399
|
+
final hasctx = entry.containsKey('ctx');
|
|
400
|
+
final hasargs = entry.containsKey('args');
|
|
401
|
+
|
|
402
|
+
if (hasctx) {
|
|
403
|
+
args = [entry['ctx']];
|
|
404
|
+
} else if (hasargs) {
|
|
405
|
+
final rawargs = entry['args'];
|
|
406
|
+
args = rawargs is List ? List<dynamic>.from(rawargs) : [rawargs];
|
|
407
|
+
} else {
|
|
408
|
+
// ABSENT, not null, when the entry supplies no `in`: Dart's `entry['in']`
|
|
409
|
+
// answers null for a missing key and for an authored `in: null` alike,
|
|
410
|
+
// and the corpus distinguishes them - struct's `minor/typify` has both
|
|
411
|
+
// `{in: null, out: <T_null>}` and `{out: <T_noval>}` (register 4.12).
|
|
412
|
+
// The typed ports get this for free because their map read returns their
|
|
413
|
+
// own absent marker; the dynamic ones have to say it (as canonical does).
|
|
414
|
+
args = [clone(entry.containsKey('in') ? entry['in'] : ABSENT)];
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if ((hasctx || hasargs) && args.isNotEmpty && ismap(args[0])) {
|
|
418
|
+
var first = clone(args[0]);
|
|
419
|
+
if (null != _provider.contextify) {
|
|
420
|
+
first = _provider.contextify!(first);
|
|
421
|
+
}
|
|
422
|
+
if (first is Map) {
|
|
423
|
+
first['client'] = client;
|
|
424
|
+
}
|
|
425
|
+
args[0] = first;
|
|
426
|
+
entry['ctx'] = first;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return args;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
void _checkresult(String label, int index, Map entry, List<dynamic> args, dynamic res) {
|
|
433
|
+
var matched = false;
|
|
434
|
+
|
|
435
|
+
if (null != entry['err']) {
|
|
436
|
+
throw _fail(label, index, entry, 'expected error did not occur',
|
|
437
|
+
stringify(entry['err']), stringify(res));
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (null != entry['match']) {
|
|
441
|
+
_match(label, index, entry, entry['match'], {
|
|
442
|
+
'in': entry['in'],
|
|
443
|
+
'args': args,
|
|
444
|
+
'out': entry['res'],
|
|
445
|
+
'ctx': entry['ctx'],
|
|
446
|
+
});
|
|
447
|
+
matched = true;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
final out = entry['out'];
|
|
451
|
+
|
|
452
|
+
if (deepequal(res, out)) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// NOTE: a match with no explicit out is a complete check on its own.
|
|
457
|
+
if (matched && (NULLMARK == out || null == out)) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
throw _fail(label, index, entry, 'result mismatch', stringify(out), stringify(res));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/// The error base a `match.err` sees: the provider's own, when it has one.
|
|
465
|
+
dynamic _errbase(dynamic err) {
|
|
466
|
+
final hook = _provider.errify;
|
|
467
|
+
return null != hook ? hook(err) : errify(err);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
void _handleerror(String label, int index, Map entry, dynamic err) {
|
|
471
|
+
final entryerr = entry['err'];
|
|
472
|
+
|
|
473
|
+
if (null != entryerr) {
|
|
474
|
+
final istrue = true == entryerr;
|
|
475
|
+
|
|
476
|
+
if (istrue || matchval(entryerr, errmessage(err))) {
|
|
477
|
+
if (null != entry['match']) {
|
|
478
|
+
_match(label, index, entry, entry['match'], {
|
|
479
|
+
'in': entry['in'],
|
|
480
|
+
'out': entry['res'],
|
|
481
|
+
'ctx': entry['ctx'],
|
|
482
|
+
'err': _errbase(err),
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
throw _fail(label, index, entry, 'error mismatch', stringify(entryerr), errmessage(err));
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
throw _fail(label, index, entry, 'unexpected error', null, errmessage(err));
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// Check that every leaf of `check` is present, and matches, in `base`.
|
|
495
|
+
void _match(String label, int index, Map entry, dynamic check, dynamic base,
|
|
496
|
+
[List<String> path = const []]) {
|
|
497
|
+
if (check is List) {
|
|
498
|
+
for (var at = 0; at < check.length; at++) {
|
|
499
|
+
_match(label, index, entry, check[at], base, [...path, '$at']);
|
|
500
|
+
}
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
if (check is Map) {
|
|
505
|
+
check.forEach((key, subcheck) {
|
|
506
|
+
_match(label, index, entry, subcheck, base, [...path, '$key']);
|
|
507
|
+
});
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
final baseval = getpath(base, path);
|
|
512
|
+
|
|
513
|
+
// The sentinels are tested BEFORE the identity check below. Otherwise
|
|
514
|
+
// a subject returning the literal string "__UNDEF__" satisfies an
|
|
515
|
+
// assertion that the key is absent - two mutually exclusive states
|
|
516
|
+
// passing one check. A sentinel that accepts its own literal is not a
|
|
517
|
+
// sentinel. (NULLMARK still accepts NULLMARK: under the default null
|
|
518
|
+
// flag a real null has already been normalised to it, so the two are
|
|
519
|
+
// genuinely indistinguishable here - that one needs a raw-value
|
|
520
|
+
// escape, not an ordering change.)
|
|
521
|
+
|
|
522
|
+
// Explicitly absent: satisfied only by a genuinely missing key, never
|
|
523
|
+
// by a present null (the distinction the sentinels exist to keep).
|
|
524
|
+
if (UNDEFMARK == check) {
|
|
525
|
+
if (isabsent(baseval)) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
throw _fail(label, index, entry, 'expected absent at ${_at(path)}',
|
|
529
|
+
'absent', stringify(baseval));
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// Explicitly null: satisfied only by a present null.
|
|
533
|
+
if (NULLMARK == check) {
|
|
534
|
+
if (null == baseval || NULLMARK == baseval) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
throw _fail(label, index, entry, 'expected null at ${_at(path)}',
|
|
538
|
+
'null', stringify(baseval));
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// Explicitly present: any present value, including null.
|
|
542
|
+
if (EXISTSMARK == check) {
|
|
543
|
+
if (!isabsent(baseval)) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
throw _fail(label, index, entry, 'expected present at ${_at(path)}',
|
|
547
|
+
'present', 'absent');
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// Identical values match. This sits below the sentinel branches on
|
|
551
|
+
// purpose - see the note above.
|
|
552
|
+
if (deepequal(check, baseval)) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// A concrete expectation never matches a missing key - a match leaf
|
|
557
|
+
// against an absent value must fail, not substring-match "undefined".
|
|
558
|
+
if (isabsent(baseval)) {
|
|
559
|
+
throw _fail(label, index, entry, 'match failed at ${_at(path)}',
|
|
560
|
+
stringify(check), 'absent');
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
if (matchval(check, baseval)) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
throw _fail(label, index, entry, 'match failed at ${_at(path)}',
|
|
568
|
+
stringify(check), stringify(baseval));
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
String _at(List<String> path) => path.isEmpty ? '<root>' : pathify(path);
|
|
572
|
+
|
|
573
|
+
// The label of one entry, for failure messages.
|
|
574
|
+
String _entryref(String label, int index, dynamic entry) {
|
|
575
|
+
final id = entry is Map ? entry['id'] : null;
|
|
576
|
+
final idpart = null == id ? '' : ' (${stringify(id)})';
|
|
577
|
+
return '$label[$index]$idpart';
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// `entry` may not be a map - checkentry calls this for an entry that
|
|
581
|
+
// failed exactly that check - so the summary below degrades to the raw
|
|
582
|
+
// value instead of assuming map access.
|
|
583
|
+
OmniError _fail(String label, int index, dynamic entry, String reason,
|
|
584
|
+
[String? expected, String? actual]) {
|
|
585
|
+
var msg = 'omni: ${_entryref(label, index, entry)}: $reason';
|
|
586
|
+
|
|
587
|
+
if (null != expected) {
|
|
588
|
+
msg += '\n expected: $expected';
|
|
589
|
+
}
|
|
590
|
+
if (null != actual) {
|
|
591
|
+
msg += '\n actual: $actual';
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
dynamic summary = entry;
|
|
595
|
+
if (entry is Map) {
|
|
596
|
+
final out = <String, dynamic>{};
|
|
597
|
+
entry.forEach((key, val) {
|
|
598
|
+
if ('res' != key && 'thrown' != key && 'ctx' != key) {
|
|
599
|
+
out['$key'] = val;
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
summary = out;
|
|
603
|
+
}
|
|
604
|
+
msg += '\n entry: ${stringify(summary)}';
|
|
605
|
+
|
|
606
|
+
return OmniError(msg, entry);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/// A loaded spec plus its provider.
|
|
611
|
+
class Runner {
|
|
612
|
+
final dynamic _alltests;
|
|
613
|
+
final Provider _provider;
|
|
614
|
+
final int _specversion;
|
|
615
|
+
|
|
616
|
+
Runner(this._alltests, this._provider, this._specversion);
|
|
617
|
+
|
|
618
|
+
/// Resolve one named section of the spec.
|
|
619
|
+
RunPack runner(String name, [dynamic store]) {
|
|
620
|
+
final spec = resolvespec(name, _alltests);
|
|
621
|
+
final clients = <String, Provider>{};
|
|
622
|
+
|
|
623
|
+
final defclient = (spec is Map && spec['DEF'] is Map) ? spec['DEF']['client'] : null;
|
|
624
|
+
|
|
625
|
+
// A spec may define clients that a given test run never references.
|
|
626
|
+
if (defclient is Map && null != _provider.client) {
|
|
627
|
+
defclient.forEach((clientname, cdef) {
|
|
628
|
+
var copts = (cdef is Map && cdef['test'] is Map) ? cdef['test']['options'] : null;
|
|
629
|
+
copts ??= <String, dynamic>{};
|
|
630
|
+
|
|
631
|
+
if (null != _provider.inject && ismap(store)) {
|
|
632
|
+
copts = _provider.inject!(copts, store);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
clients['$clientname'] = _provider.client!(copts);
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
final subject = _provider.subject?.call(name);
|
|
640
|
+
|
|
641
|
+
return RunPack(spec, subject, _provider, clients, name, _specversion);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
/// Make a runner for a spec file path (or spec value) and a provider.
|
|
646
|
+
/// The spec's format version is resolved immediately - a version the
|
|
647
|
+
/// runner cannot faithfully run fails here, at load time, not on the
|
|
648
|
+
/// first `runset` call.
|
|
649
|
+
Runner makeRunner(dynamic specref, [Provider provider = const Provider()]) {
|
|
650
|
+
final alltests = specref is String ? loadspec(specref) : specref;
|
|
651
|
+
final specversion = _resolveversion(alltests);
|
|
652
|
+
return Runner(alltests, provider, specversion);
|
|
653
|
+
}
|