@tiqian/protocol 0.0.0-stage.1 → 0.1.0-alpha.10

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.
Files changed (228) hide show
  1. package/dist/haxe/crypto/Sha256.d.ts +19 -0
  2. package/dist/haxe/crypto/Sha256.js +194 -0
  3. package/dist/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
  4. package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
  5. package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
  6. package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
  7. package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
  8. package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
  9. package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
  10. package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
  11. package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
  12. package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
  13. package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
  14. package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
  15. package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
  16. package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
  17. package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
  18. package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
  19. package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
  20. package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
  21. package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
  22. package/dist/org/tiqian/clreq/GlueSide.js +17 -0
  23. package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
  24. package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
  25. package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
  26. package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
  27. package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
  28. package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
  29. package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
  30. package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
  31. package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
  32. package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
  33. package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
  34. package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
  35. package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
  36. package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
  37. package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
  38. package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
  39. package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
  40. package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
  41. package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
  42. package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
  43. package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
  44. package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
  45. package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
  46. package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
  47. package/dist/org/tiqian/core/Cluster.d.ts +13 -0
  48. package/dist/org/tiqian/core/Cluster.js +24 -0
  49. package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
  50. package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
  51. package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
  52. package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
  53. package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
  54. package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
  55. package/dist/org/tiqian/core/Ic.d.ts +7 -0
  56. package/dist/org/tiqian/core/Ic.js +17 -0
  57. package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
  58. package/dist/org/tiqian/core/IllegalStateException.js +8 -0
  59. package/dist/org/tiqian/core/IntRange.d.ts +12 -0
  60. package/dist/org/tiqian/core/IntRange.js +30 -0
  61. package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
  62. package/dist/org/tiqian/core/LineEndReason.js +17 -0
  63. package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
  64. package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
  65. package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
  66. package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
  67. package/dist/org/tiqian/core/TextRange.d.ts +11 -0
  68. package/dist/org/tiqian/core/TextRange.js +40 -0
  69. package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
  70. package/dist/org/tiqian/core/TextRangeError.js +2 -0
  71. package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
  72. package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
  73. package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
  74. package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
  75. package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
  76. package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
  77. package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
  78. package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
  79. package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
  80. package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
  81. package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
  82. package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
  83. package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
  84. package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
  85. package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
  86. package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
  87. package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
  88. package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
  89. package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
  90. package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
  91. package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
  92. package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
  93. package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
  94. package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
  95. package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
  96. package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
  97. package/dist/org/tiqian/font/FontRole.d.ts +28 -0
  98. package/dist/org/tiqian/font/FontRole.js +26 -0
  99. package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
  100. package/dist/org/tiqian/font/FontRoleContext.js +28 -0
  101. package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
  102. package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
  103. package/dist/org/tiqian/layout/LineOptimization.d.ts +124 -0
  104. package/dist/org/tiqian/layout/LineOptimization.js +298 -0
  105. package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
  106. package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
  107. package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
  108. package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
  109. package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
  110. package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
  111. package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
  112. package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
  113. package/dist/org/tiqian/protocol/Canonical.d.ts +55 -0
  114. package/dist/org/tiqian/protocol/Canonical.js +471 -0
  115. package/dist/org/tiqian/protocol/DecorationInput.d.ts +6 -0
  116. package/dist/org/tiqian/protocol/DecorationInput.js +12 -0
  117. package/dist/org/tiqian/protocol/EncodeResult.d.ts +9 -0
  118. package/dist/org/tiqian/protocol/EncodeResult.js +2 -0
  119. package/dist/org/tiqian/protocol/FaceInfo.d.ts +13 -0
  120. package/dist/org/tiqian/protocol/FaceInfo.js +2 -0
  121. package/dist/org/tiqian/protocol/FontContract.d.ts +25 -0
  122. package/dist/org/tiqian/protocol/FontContract.js +317 -0
  123. package/dist/org/tiqian/protocol/FontFaceRecord.d.ts +6 -0
  124. package/dist/org/tiqian/protocol/FontFaceRecord.js +2 -0
  125. package/dist/org/tiqian/protocol/FontFaceSpec.d.ts +11 -0
  126. package/dist/org/tiqian/protocol/FontFaceSpec.js +2 -0
  127. package/dist/org/tiqian/protocol/FontWeightSpec.d.ts +10 -0
  128. package/dist/org/tiqian/protocol/FontWeightSpec.js +2 -0
  129. package/dist/org/tiqian/protocol/InlineBoxInput.d.ts +7 -0
  130. package/dist/org/tiqian/protocol/InlineBoxInput.js +2 -0
  131. package/dist/org/tiqian/protocol/InlineObjectInput.d.ts +7 -0
  132. package/dist/org/tiqian/protocol/InlineObjectInput.js +2 -0
  133. package/dist/org/tiqian/protocol/JsCoerce.d.ts +19 -0
  134. package/dist/org/tiqian/protocol/JsCoerce.js +394 -0
  135. package/dist/org/tiqian/protocol/LayoutAttribute.d.ts +5 -0
  136. package/dist/org/tiqian/protocol/LayoutAttribute.js +10 -0
  137. package/dist/org/tiqian/protocol/LayoutFloatShape.d.ts +14 -0
  138. package/dist/org/tiqian/protocol/LayoutFloatShape.js +2 -0
  139. package/dist/org/tiqian/protocol/LayoutTree.d.ts +23 -0
  140. package/dist/org/tiqian/protocol/LayoutTree.js +2 -0
  141. package/dist/org/tiqian/protocol/LayoutVertex.d.ts +4 -0
  142. package/dist/org/tiqian/protocol/LayoutVertex.js +2 -0
  143. package/dist/org/tiqian/protocol/LineBreakSpanInput.d.ts +6 -0
  144. package/dist/org/tiqian/protocol/LineBreakSpanInput.js +12 -0
  145. package/dist/org/tiqian/protocol/MetricEntry.d.ts +11 -0
  146. package/dist/org/tiqian/protocol/MetricEntry.js +21 -0
  147. package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
  148. package/dist/org/tiqian/protocol/NamedError.js +71 -0
  149. package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
  150. package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
  151. package/dist/org/tiqian/protocol/ParagraphRequest.d.ts +25 -0
  152. package/dist/org/tiqian/protocol/ParagraphRequest.js +2 -0
  153. package/dist/org/tiqian/protocol/ParagraphRequestChecks.d.ts +8 -0
  154. package/dist/org/tiqian/protocol/ParagraphRequestChecks.js +145 -0
  155. package/dist/org/tiqian/protocol/ParagraphRequestException.d.ts +6 -0
  156. package/dist/org/tiqian/protocol/ParagraphRequestException.js +55 -0
  157. package/dist/org/tiqian/protocol/ParagraphRequestFields.d.ts +3 -0
  158. package/dist/org/tiqian/protocol/ParagraphRequestFields.js +4 -0
  159. package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
  160. package/dist/org/tiqian/protocol/Plan.js +10 -0
  161. package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
  162. package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
  163. package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
  164. package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
  165. package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
  166. package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
  167. package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
  168. package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
  169. package/dist/org/tiqian/protocol/Revision.d.ts +11 -0
  170. package/dist/org/tiqian/protocol/Revision.js +12 -0
  171. package/dist/org/tiqian/protocol/SessionFaceSpec.d.ts +5 -0
  172. package/dist/org/tiqian/protocol/SessionFaceSpec.js +2 -0
  173. package/dist/org/tiqian/protocol/SnapshotTableBinary.d.ts +55 -0
  174. package/dist/org/tiqian/protocol/SnapshotTableBinary.js +657 -0
  175. package/dist/org/tiqian/protocol/SnapshotTypography.d.ts +14 -0
  176. package/dist/org/tiqian/protocol/SnapshotTypography.js +2 -0
  177. package/dist/org/tiqian/protocol/StyleRow.d.ts +8 -0
  178. package/dist/org/tiqian/protocol/StyleRow.js +15 -0
  179. package/dist/org/tiqian/protocol/TableData.d.ts +25 -0
  180. package/dist/org/tiqian/protocol/TableData.js +45 -0
  181. package/dist/org/tiqian/protocol/TableInput.d.ts +13 -0
  182. package/dist/org/tiqian/protocol/TableInput.js +21 -0
  183. package/dist/org/tiqian/protocol/TableMetricRow.d.ts +9 -0
  184. package/dist/org/tiqian/protocol/TableMetricRow.js +17 -0
  185. package/dist/org/tiqian/protocol/TableProbe.d.ts +11 -0
  186. package/dist/org/tiqian/protocol/TableProbe.js +21 -0
  187. package/dist/org/tiqian/protocol/TextSpanInput.d.ts +9 -0
  188. package/dist/org/tiqian/protocol/TextSpanInput.js +2 -0
  189. package/dist/org/tiqian/protocol/ValueRow.d.ts +4 -0
  190. package/dist/org/tiqian/protocol/ValueRow.js +7 -0
  191. package/dist/org/tiqian/protocol/WireField.d.ts +5 -0
  192. package/dist/org/tiqian/protocol/WireField.js +2 -0
  193. package/dist/org/tiqian/protocol/WireValue.d.ts +25 -0
  194. package/dist/org/tiqian/protocol/WireValue.js +2 -0
  195. package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
  196. package/dist/org/tiqian/test/TestHelpers.js +27 -0
  197. package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
  198. package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
  199. package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
  200. package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
  201. package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
  202. package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
  203. package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
  204. package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
  205. package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
  206. package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
  207. package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
  208. package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
  209. package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
  210. package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
  211. package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
  212. package/dist/org/tiqian/test/trace/TraceField.js +10 -0
  213. package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
  214. package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
  215. package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
  216. package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
  217. package/dist/runtime.d.ts +96 -0
  218. package/dist/runtime.js +1612 -0
  219. package/dist/std/FsError.d.ts +48 -0
  220. package/dist/std/FsError.js +2 -0
  221. package/dist/std/FsException.d.ts +6 -0
  222. package/dist/std/FsException.js +45 -0
  223. package/dist/std/UStringException.d.ts +6 -0
  224. package/dist/std/UStringException.js +21 -0
  225. package/dist/std/UStringFault.d.ts +9 -0
  226. package/dist/std/UStringFault.js +2 -0
  227. package/package.json +26 -4
  228. package/README.md +0 -3
@@ -0,0 +1,749 @@
1
+ // Generated by the reflaxe TypeScript target. Do not edit.
2
+ import { ClreqProfile } from "./../../clreq/ClreqProfile.js";
3
+ import { toString } from "./../../core/Ic.js";
4
+ import { IllegalStateException } from "./../../core/IllegalStateException.js";
5
+ import { TiqianIllegalArgumentException } from "./../../core/TiqianIllegalArgumentException.js";
6
+ import { TiqianNoSuchElementException } from "./../../core/TiqianNoSuchElementException.js";
7
+ import { TestHelpers } from "./../TestHelpers.js";
8
+ import { TestTrace } from "./TestTrace.js";
9
+ import { TestTraceRender } from "./TestTraceRender.js";
10
+ import { TraceAssertionException } from "./TraceAssertionException.js";
11
+ import { UStringException } from "./../../../../std/UStringException.js";
12
+ import { SortedTable } from "../../../../runtime.js";
13
+ export class TracedAssertions {
14
+ static assertEquals(expected, actual, message) {
15
+ message = message ?? null;
16
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TestTraceRender.renderInt(expected)), TracedAssertions.field("actual", TestTraceRender.renderInt(actual)), TracedAssertions.msgField(message)]);
17
+ if (expected !== actual) {
18
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
19
+ }
20
+ }
21
+ static assertEqualsBool(expected, actual, message) {
22
+ message = message ?? null;
23
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TestTraceRender.renderBool(expected)), TracedAssertions.field("actual", TestTraceRender.renderBool(actual)), TracedAssertions.msgField(message)]);
24
+ if (expected !== actual) {
25
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
26
+ }
27
+ }
28
+ static assertEqualsNullableRepairOption(expected, actual, message) {
29
+ message = message ?? null;
30
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", (expected === null ? "-" : TracedAssertions.renderRepairOption((expected)))), TracedAssertions.field("actual", (actual === null ? "-" : TracedAssertions.renderRepairOption((actual)))), TracedAssertions.msgField(message)]);
31
+ if (expected !== actual) {
32
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
33
+ }
34
+ }
35
+ static assertEqualsNullableString(expected, actual, message) {
36
+ message = message ?? null;
37
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", (expected === null ? "-" : TestTraceRender.renderString((expected)))), TracedAssertions.field("actual", (actual === null ? "-" : TestTraceRender.renderString((actual)))), TracedAssertions.msgField(message)]);
38
+ if (expected !== actual) {
39
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
40
+ }
41
+ }
42
+ static assertEqualsString(expected, actual, message) {
43
+ message = message ?? null;
44
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TestTraceRender.renderString(expected)), TracedAssertions.field("actual", TestTraceRender.renderString(actual)), TracedAssertions.msgField(message)]);
45
+ if (expected !== actual) {
46
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
47
+ }
48
+ }
49
+ static assertEqualsIc(expected, actual, message) {
50
+ message = message ?? null;
51
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", toString(expected)), TracedAssertions.field("actual", toString(actual)), TracedAssertions.msgField(message)]);
52
+ if (expected !== actual) {
53
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
54
+ }
55
+ }
56
+ static assertEqualsEnum(expected, actual, message) {
57
+ message = message ?? null;
58
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", String(expected)), TracedAssertions.field("actual", String(actual)), TracedAssertions.msgField(message)]);
59
+ if (expected !== actual) {
60
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
61
+ }
62
+ }
63
+ static assertEqualsEastAsianSpacingEdges(expected, actual, message) {
64
+ message = message ?? null;
65
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.toString()), TracedAssertions.field("actual", actual.toString()), TracedAssertions.msgField(message)]);
66
+ if (expected.leading !== actual.leading || expected.trailing !== actual.trailing || expected.containsWide !== actual.containsWide) {
67
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
68
+ }
69
+ }
70
+ static assertEqualsIntArray(expected, actual, message) {
71
+ message = message ?? null;
72
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TracedAssertions.renderInts(expected)), TracedAssertions.field("actual", TracedAssertions.renderInts(actual)), TracedAssertions.msgField(message)]);
73
+ if (expected.length !== actual.length) {
74
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
75
+ }
76
+ let i = 0;
77
+ while (i < expected.length) {
78
+ if (expected[i] !== actual[i]) {
79
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
80
+ }
81
+ i++;
82
+ }
83
+ }
84
+ static renderInts(values) {
85
+ let buf = [];
86
+ const tail = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
87
+ if (tail >= 55296 && tail <= 56319) {
88
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail });
89
+ }
90
+ buf.push("[");
91
+ let i = 0;
92
+ while (i < values.length) {
93
+ if (i > 0) {
94
+ const tail2 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
95
+ if (tail2 >= 55296 && tail2 <= 56319) {
96
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail2 });
97
+ }
98
+ buf.push(", ");
99
+ }
100
+ const tail3 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
101
+ if (tail3 >= 55296 && tail3 <= 56319 && `${values[i]}`.length > 0 && !(`${values[i]}`.charCodeAt(0) >= 56320 && `${values[i]}`.charCodeAt(0) <= 57343)) {
102
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail3 });
103
+ }
104
+ if (`${values[i]}`.length > 0) {
105
+ buf.push(`${values[i]}`);
106
+ }
107
+ i++;
108
+ }
109
+ const tail4 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
110
+ if (tail4 >= 55296 && tail4 <= 56319) {
111
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail4 });
112
+ }
113
+ buf.push("]");
114
+ const tail5 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
115
+ if (tail5 >= 55296 && tail5 <= 56319) {
116
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail5 });
117
+ }
118
+ return buf.join("");
119
+ }
120
+ static assertEqualsStringArray(expected, actual, message) {
121
+ message = message ?? null;
122
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TestTraceRender.renderStringArray(expected)), TracedAssertions.field("actual", TestTraceRender.renderStringArray(actual)), TracedAssertions.msgField(message)]);
123
+ if (!TracedAssertions.sameStringArray(expected, actual)) {
124
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
125
+ }
126
+ }
127
+ static assertEqualsBopomofoTone(expected, actual, message) {
128
+ message = message ?? null;
129
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", actual.kind), TracedAssertions.msgField(message)]);
130
+ if (expected !== actual) {
131
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
132
+ }
133
+ }
134
+ static assertEqualsFontRole(expected, actual, message) {
135
+ message = message ?? null;
136
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", (actual === null ? "null" : TracedAssertions.renderFontRole((actual)))), TracedAssertions.msgField(message)]);
137
+ if (actual === null || expected !== actual) {
138
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
139
+ }
140
+ }
141
+ static renderFontRole(value) {
142
+ return value.kind;
143
+ }
144
+ static assertEqualsQuoteType(expected, actual, message) {
145
+ message = message ?? null;
146
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", actual.kind), TracedAssertions.msgField(message)]);
147
+ if (expected !== actual) {
148
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
149
+ }
150
+ }
151
+ static assertEqualsQuotePair(expected, actual, message) {
152
+ message = message ?? null;
153
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.toString()), TracedAssertions.field("actual", actual.toString()), TracedAssertions.msgField(message)]);
154
+ if (expected.openIndex !== actual.openIndex || expected.closeIndex !== actual.closeIndex || expected.quoteType !== actual.quoteType) {
155
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
156
+ }
157
+ }
158
+ static renderQuotePairs(values) {
159
+ let buf = [];
160
+ const tail6 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
161
+ if (tail6 >= 55296 && tail6 <= 56319) {
162
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail6 });
163
+ }
164
+ buf.push("[");
165
+ let i = 0;
166
+ while (i < values.length) {
167
+ if (i > 0) {
168
+ const tail7 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
169
+ if (tail7 >= 55296 && tail7 <= 56319) {
170
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail7 });
171
+ }
172
+ buf.push(", ");
173
+ }
174
+ const tail8 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
175
+ if (tail8 >= 55296 && tail8 <= 56319 && values[i].toString().length > 0 && !(values[i].toString().charCodeAt(0) >= 56320 && values[i].toString().charCodeAt(0) <= 57343)) {
176
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail8 });
177
+ }
178
+ if (values[i].toString().length > 0) {
179
+ buf.push(values[i].toString());
180
+ }
181
+ i++;
182
+ }
183
+ const tail9 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
184
+ if (tail9 >= 55296 && tail9 <= 56319) {
185
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail9 });
186
+ }
187
+ buf.push("]");
188
+ const tail10 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
189
+ if (tail10 >= 55296 && tail10 <= 56319) {
190
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail10 });
191
+ }
192
+ return buf.join("");
193
+ }
194
+ static assertEqualsQuotePairArray(expected, actual, message) {
195
+ message = message ?? null;
196
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TracedAssertions.renderQuotePairs(expected)), TracedAssertions.field("actual", TracedAssertions.renderQuotePairs(actual)), TracedAssertions.msgField(message)]);
197
+ if (expected.length !== actual.length) {
198
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
199
+ }
200
+ let i = 0;
201
+ while (i < expected.length) {
202
+ if (expected[i].openIndex !== actual[i].openIndex || expected[i].closeIndex !== actual[i].closeIndex || expected[i].quoteType !== actual[i].quoteType) {
203
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
204
+ }
205
+ i++;
206
+ }
207
+ }
208
+ static assertEqualsNullableInt(expected, actual, message) {
209
+ message = message ?? null;
210
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", (expected === null ? "-" : TestTraceRender.renderInt((expected)))), TracedAssertions.field("actual", (actual === null ? "-" : TestTraceRender.renderInt((actual)))), TracedAssertions.msgField(message)]);
211
+ if (expected !== actual) {
212
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
213
+ }
214
+ }
215
+ static assertEqualsNullableFloat(expected, actual, message) {
216
+ message = message ?? null;
217
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", (expected === null ? "-" : TestTraceRender.renderFloat((expected)))), TracedAssertions.field("actual", (actual === null ? "-" : TestTraceRender.renderFloat((actual)))), TracedAssertions.msgField(message)]);
218
+ if (expected !== actual) {
219
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
220
+ }
221
+ }
222
+ static assertEqualsTextRangeArray(expected, actual, message) {
223
+ message = message ?? null;
224
+ const expectedText = TracedAssertions.renderTextRangeArray(expected);
225
+ const actualText = TracedAssertions.renderTextRangeArray(actual);
226
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expectedText), TracedAssertions.field("actual", actualText), TracedAssertions.msgField(message)]);
227
+ const count = expected.length;
228
+ if (count !== actual.length) {
229
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
230
+ }
231
+ for (let i = 0; i < count; i += 1) {
232
+ if (expected[i].start !== actual[i].start || expected[i].end !== actual[i].end) {
233
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
234
+ }
235
+ }
236
+ }
237
+ static renderTextRangeArray(ranges) {
238
+ const parts = [];
239
+ for (let i = 0, count2 = ranges.length; i < count2; i += 1) {
240
+ parts.push(ranges[i].toString());
241
+ }
242
+ return `[${parts.join(", ")}]`;
243
+ }
244
+ static assertEqualsIntRange(expected, actual, message) {
245
+ message = message ?? null;
246
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TracedAssertions.renderIntRange(expected)), TracedAssertions.field("actual", TracedAssertions.renderIntRange(actual)), TracedAssertions.msgField(message)]);
247
+ if (expected.start !== actual.start || expected.end !== actual.end) {
248
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
249
+ }
250
+ }
251
+ static renderIntRange(r) {
252
+ let buf = [];
253
+ const tail11 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
254
+ if (tail11 >= 55296 && tail11 <= 56319) {
255
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail11 });
256
+ }
257
+ buf.push("[");
258
+ let i = r.start;
259
+ while (i <= r.end) {
260
+ if (i > r.start) {
261
+ const tail12 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
262
+ if (tail12 >= 55296 && tail12 <= 56319) {
263
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail12 });
264
+ }
265
+ buf.push(", ");
266
+ }
267
+ const tail13 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
268
+ if (tail13 >= 55296 && tail13 <= 56319 && TestTraceRender.renderInt(i).length > 0 && !(TestTraceRender.renderInt(i).charCodeAt(0) >= 56320 && TestTraceRender.renderInt(i).charCodeAt(0) <= 57343)) {
269
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail13 });
270
+ }
271
+ if (TestTraceRender.renderInt(i).length > 0) {
272
+ buf.push(TestTraceRender.renderInt(i));
273
+ }
274
+ i++;
275
+ }
276
+ const tail14 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
277
+ if (tail14 >= 55296 && tail14 <= 56319) {
278
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail14 });
279
+ }
280
+ buf.push("]");
281
+ const tail15 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
282
+ if (tail15 >= 55296 && tail15 <= 56319) {
283
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail15 });
284
+ }
285
+ return buf.join("");
286
+ }
287
+ static assertEqualsIntSet(expected, actual, message) {
288
+ message = message ?? null;
289
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TracedAssertions.renderIntSet(expected)), TracedAssertions.field("actual", TracedAssertions.renderIntSet(actual)), TracedAssertions.msgField(message)]);
290
+ if (expected.size() !== actual.size()) {
291
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
292
+ }
293
+ let i = 0;
294
+ while (i < expected.size()) {
295
+ if (expected.at(i) !== actual.at(i)) {
296
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
297
+ }
298
+ i++;
299
+ }
300
+ }
301
+ static renderIntSet(values) {
302
+ let buf = [];
303
+ const tail16 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
304
+ if (tail16 >= 55296 && tail16 <= 56319) {
305
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail16 });
306
+ }
307
+ buf.push("[");
308
+ let i = 0;
309
+ while (i < values.size()) {
310
+ if (i > 0) {
311
+ const tail17 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
312
+ if (tail17 >= 55296 && tail17 <= 56319) {
313
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail17 });
314
+ }
315
+ buf.push(", ");
316
+ }
317
+ const tail18 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
318
+ if (tail18 >= 55296 && tail18 <= 56319 && TestTraceRender.renderInt(values.at(i)).length > 0 && !(TestTraceRender.renderInt(values.at(i)).charCodeAt(0) >= 56320 && TestTraceRender.renderInt(values.at(i)).charCodeAt(0) <= 57343)) {
319
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail18 });
320
+ }
321
+ if (TestTraceRender.renderInt(values.at(i)).length > 0) {
322
+ buf.push(TestTraceRender.renderInt(values.at(i)));
323
+ }
324
+ i++;
325
+ }
326
+ const tail19 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
327
+ if (tail19 >= 55296 && tail19 <= 56319) {
328
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail19 });
329
+ }
330
+ buf.push("]");
331
+ const tail20 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
332
+ if (tail20 >= 55296 && tail20 <= 56319) {
333
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail20 });
334
+ }
335
+ return buf.join("");
336
+ }
337
+ static assertEqualsIntSetUnordered(expected, actual, message) {
338
+ message = message ?? null;
339
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TracedAssertions.renderIntListInGivenOrder(expected)), TracedAssertions.field("actual", TracedAssertions.renderIntListInGivenOrder(actual)), TracedAssertions.msgField(message)]);
340
+ const expectedSet = SortedTable.setBuilder(SortedTable.compareInts);
341
+ let i = 0;
342
+ while (i < expected.length) {
343
+ expectedSet.put(expected[i]);
344
+ i++;
345
+ }
346
+ const actualSet = SortedTable.setBuilder(SortedTable.compareInts);
347
+ i = 0;
348
+ while (i < actual.length) {
349
+ actualSet.put(actual[i]);
350
+ i++;
351
+ }
352
+ const e = expectedSet.build();
353
+ const a = actualSet.build();
354
+ if (e.size() !== a.size()) {
355
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
356
+ }
357
+ i = 0;
358
+ while (i < e.size()) {
359
+ if (e.at(i) !== a.at(i)) {
360
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
361
+ }
362
+ i++;
363
+ }
364
+ }
365
+ static renderIntListInGivenOrder(values) {
366
+ let buf = [];
367
+ const tail21 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
368
+ if (tail21 >= 55296 && tail21 <= 56319) {
369
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail21 });
370
+ }
371
+ buf.push("[");
372
+ let i = 0;
373
+ while (i < values.length) {
374
+ if (i > 0) {
375
+ const tail22 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
376
+ if (tail22 >= 55296 && tail22 <= 56319) {
377
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail22 });
378
+ }
379
+ buf.push(", ");
380
+ }
381
+ const tail23 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
382
+ if (tail23 >= 55296 && tail23 <= 56319 && TestTraceRender.renderInt(values[i]).length > 0 && !(TestTraceRender.renderInt(values[i]).charCodeAt(0) >= 56320 && TestTraceRender.renderInt(values[i]).charCodeAt(0) <= 57343)) {
383
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail23 });
384
+ }
385
+ if (TestTraceRender.renderInt(values[i]).length > 0) {
386
+ buf.push(TestTraceRender.renderInt(values[i]));
387
+ }
388
+ i++;
389
+ }
390
+ const tail24 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
391
+ if (tail24 >= 55296 && tail24 <= 56319) {
392
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail24 });
393
+ }
394
+ buf.push("]");
395
+ const tail25 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
396
+ if (tail25 >= 55296 && tail25 <= 56319) {
397
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail25 });
398
+ }
399
+ return buf.join("");
400
+ }
401
+ static assertEqualsRepairOptionArray(expected, actual, message) {
402
+ message = message ?? null;
403
+ const expectedText = TracedAssertions.renderRepairOptionList(expected);
404
+ const actualText = TracedAssertions.renderRepairOptionList(actual);
405
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expectedText), TracedAssertions.field("actual", actualText), TracedAssertions.msgField(message)]);
406
+ if (expectedText !== actualText) {
407
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
408
+ }
409
+ }
410
+ static renderRepairOptionList(values) {
411
+ let buf = [];
412
+ const tail26 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
413
+ if (tail26 >= 55296 && tail26 <= 56319) {
414
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail26 });
415
+ }
416
+ buf.push("[");
417
+ let i = 0;
418
+ while (i < values.length) {
419
+ if (i > 0) {
420
+ const tail27 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
421
+ if (tail27 >= 55296 && tail27 <= 56319) {
422
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail27 });
423
+ }
424
+ buf.push(", ");
425
+ }
426
+ const tail28 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
427
+ if (tail28 >= 55296 && tail28 <= 56319 && TracedAssertions.renderRepairOption(values[i]).length > 0 && !(TracedAssertions.renderRepairOption(values[i]).charCodeAt(0) >= 56320 && TracedAssertions.renderRepairOption(values[i]).charCodeAt(0) <= 57343)) {
428
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail28 });
429
+ }
430
+ if (TracedAssertions.renderRepairOption(values[i]).length > 0) {
431
+ buf.push(TracedAssertions.renderRepairOption(values[i]));
432
+ }
433
+ i++;
434
+ }
435
+ const tail29 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
436
+ if (tail29 >= 55296 && tail29 <= 56319) {
437
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail29 });
438
+ }
439
+ buf.push("]");
440
+ const tail30 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
441
+ if (tail30 >= 55296 && tail30 <= 56319) {
442
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail30 });
443
+ }
444
+ return buf.join("");
445
+ }
446
+ static renderRepairOption(option) {
447
+ return option.kind === "LeaveRagged" ? ("LeaveRagged(penalty=" + option.penalty + ", reason=" + option.reason + ", offenderClusterIndex=" + option.offenderClusterIndex + ")") : option.kind === "CarryNext" ? ("CarryNext(penalty=" + option.penalty + ", reason=" + option.reason + ", movedClusterIndex=" + option.movedClusterIndex + ")") : option.kind === "CarryPrevious" ? ("CarryPrevious(penalty=" + option.penalty + ", reason=" + option.reason + ", offenderClusterIndex=" + option.offenderClusterIndex + ", carriedClusterIndex=" + option.carriedClusterIndex + ")") : option.kind === "Hang" ? ("Hang(penalty=" + option.penalty + ", reason=" + option.reason + ", offenderClusterIndex=" + option.offenderClusterIndex + ")") : ("PushIn(penalty=" + option.penalty + ", reason=" + option.reason + ", offenderClusterIndex=" + option.offenderClusterIndex + ", allocations=" + (() => { let out = "["; const n = option.allocations.length; for (let i = 0; i < n; i += 1) {
448
+ if (i > 0) {
449
+ out += ", ";
450
+ }
451
+ out += option.allocations[i].toString();
452
+ } out += "]"; return out; })() + ", totalShrink=" + option.totalShrink + ", totalAvailableCapacity=" + option.totalAvailableCapacity + ")");
453
+ }
454
+ static renderPushInAllocations(values) {
455
+ let buf = [];
456
+ const tail31 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
457
+ if (tail31 >= 55296 && tail31 <= 56319) {
458
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail31 });
459
+ }
460
+ buf.push("[");
461
+ let i = 0;
462
+ while (i < values.length) {
463
+ if (i > 0) {
464
+ const tail32 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
465
+ if (tail32 >= 55296 && tail32 <= 56319) {
466
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail32 });
467
+ }
468
+ buf.push(", ");
469
+ }
470
+ const tail33 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
471
+ if (tail33 >= 55296 && tail33 <= 56319 && values[i].toString().length > 0 && !(values[i].toString().charCodeAt(0) >= 56320 && values[i].toString().charCodeAt(0) <= 57343)) {
472
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail33 });
473
+ }
474
+ if (values[i].toString().length > 0) {
475
+ buf.push(values[i].toString());
476
+ }
477
+ i++;
478
+ }
479
+ const tail34 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
480
+ if (tail34 >= 55296 && tail34 <= 56319) {
481
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail34 });
482
+ }
483
+ buf.push("]");
484
+ const tail35 = buf.length > 0 ? buf[buf.length - 1].charCodeAt(buf[buf.length - 1].length - 1) : NaN;
485
+ if (tail35 >= 55296 && tail35 <= 56319) {
486
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail35 });
487
+ }
488
+ return buf.join("");
489
+ }
490
+ static assertEqualsPushInAllocationArray(expected, actual, message) {
491
+ message = message ?? null;
492
+ const expectedText = TracedAssertions.renderPushInAllocations(expected);
493
+ const actualText = TracedAssertions.renderPushInAllocations(actual);
494
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expectedText), TracedAssertions.field("actual", actualText), TracedAssertions.msgField(message)]);
495
+ if (expectedText !== actualText) {
496
+ TracedAssertions.fail((message === null ? "Expected arrays to be equal." : message), null);
497
+ }
498
+ }
499
+ static assertEqualsBopomofoReading(expected, actual, message) {
500
+ message = message ?? null;
501
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.toString()), TracedAssertions.field("actual", actual.toString()), TracedAssertions.msgField(message)]);
502
+ if (!TracedAssertions.sameStringArray(expected.symbols, actual.symbols) || expected.tone !== actual.tone) {
503
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
504
+ }
505
+ }
506
+ static assertEqualsPunctuationClass(expected, actual, message) {
507
+ message = message ?? null;
508
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", actual.kind), TracedAssertions.msgField(message)]);
509
+ if (expected !== actual) {
510
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
511
+ }
512
+ }
513
+ static assertEqualsGlueSide(expected, actual, message) {
514
+ message = message ?? null;
515
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", actual.kind), TracedAssertions.msgField(message)]);
516
+ if (expected !== actual) {
517
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
518
+ }
519
+ }
520
+ static assertEqualsPunctuationGluePlacement(expected, actual, message) {
521
+ message = message ?? null;
522
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", actual.kind), TracedAssertions.msgField(message)]);
523
+ if (expected !== actual) {
524
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
525
+ }
526
+ }
527
+ static assertEqualsKinsokuLevel(expected, actual, message) {
528
+ message = message ?? null;
529
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", actual.kind), TracedAssertions.msgField(message)]);
530
+ if (expected !== actual) {
531
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
532
+ }
533
+ }
534
+ static assertEqualsHangingPunctuationStyle(expected, actual, message) {
535
+ message = message ?? null;
536
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expected.kind), TracedAssertions.field("actual", actual.kind), TracedAssertions.msgField(message)]);
537
+ if (expected !== actual) {
538
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
539
+ }
540
+ }
541
+ static assertEqualsClreqProfile(expected, actual, message) {
542
+ message = message ?? null;
543
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TestTraceRender.cap(expected.toString())), TracedAssertions.field("actual", TestTraceRender.cap(actual.toString())), TracedAssertions.msgField(message)]);
544
+ if (!ClreqProfile.sameProfile(expected, actual)) {
545
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
546
+ }
547
+ }
548
+ static sameStringArray(first, second) {
549
+ if (first.length !== second.length) {
550
+ return false;
551
+ }
552
+ let index = 0;
553
+ while (index < first.length) {
554
+ if (first[index] !== second[index]) {
555
+ return false;
556
+ }
557
+ index += 1;
558
+ }
559
+ return true;
560
+ }
561
+ static f32Literal(value) {
562
+ return TestHelpers.f32Literal(value);
563
+ }
564
+ static assertEqualsFloat(expected, actual, message) {
565
+ message = message ?? null;
566
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TestTraceRender.renderFloat(expected)), TracedAssertions.field("actual", TestTraceRender.renderFloat(actual)), TracedAssertions.msgField(message)]);
567
+ if (expected !== actual) {
568
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
569
+ }
570
+ }
571
+ static assertEqualsFloatTolerance(expected, actual, tolerance, message) {
572
+ message = message ?? null;
573
+ TracedAssertions.recordEvent("eq-tol", [TracedAssertions.field("expected", TestTraceRender.renderFloat(expected)), TracedAssertions.field("actual", TestTraceRender.renderFloat(actual)), TracedAssertions.field("tol", TestTraceRender.renderFloat(tolerance)), TracedAssertions.msgField(message)]);
574
+ if (expected !== expected || actual !== actual || Math.abs(expected - actual) > tolerance) {
575
+ TracedAssertions.fail((message === null ? "Expected values to be equal within tolerance." : message), null);
576
+ }
577
+ }
578
+ static assertEqualsRendered(expected, actual, message) {
579
+ message = message ?? null;
580
+ const expectedText = TestTraceRender.cap(expected);
581
+ const actualText = TestTraceRender.cap(actual);
582
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", expectedText), TracedAssertions.field("actual", actualText), TracedAssertions.msgField(message)]);
583
+ if (expectedText !== actualText) {
584
+ TracedAssertions.fail((message === null ? "Expected rendered values to be equal." : message), null);
585
+ }
586
+ }
587
+ static assertEqualsInt(expected, actual, message) {
588
+ message = message ?? null;
589
+ TracedAssertions.recordEvent("eq", [TracedAssertions.field("expected", TestTraceRender.renderInt(expected)), TracedAssertions.field("actual", TestTraceRender.renderInt(actual)), TracedAssertions.msgField(message)]);
590
+ if (expected !== actual) {
591
+ TracedAssertions.fail((message === null ? "Expected values to be equal." : message), null);
592
+ }
593
+ }
594
+ static assertTrue(actual, message) {
595
+ message = message ?? null;
596
+ TracedAssertions.recordEvent("is-true", [TracedAssertions.field("actual", TestTraceRender.renderBool(actual)), TracedAssertions.msgField(message)]);
597
+ if (!actual) {
598
+ TracedAssertions.fail((message === null ? "Expected value to be true." : message), null);
599
+ }
600
+ }
601
+ static assertFalse(actual, message) {
602
+ message = message ?? null;
603
+ TracedAssertions.recordEvent("is-false", [TracedAssertions.field("actual", TestTraceRender.renderBool(actual)), TracedAssertions.msgField(message)]);
604
+ if (actual) {
605
+ TracedAssertions.fail((message === null ? "Expected value to be false." : message), null);
606
+ }
607
+ }
608
+ static assertNullRendered(wasNull, renderedActual, message) {
609
+ message = message ?? null;
610
+ TracedAssertions.recordEvent("null", [TracedAssertions.field("actual", renderedActual), TracedAssertions.msgField(message)]);
611
+ if (!wasNull) {
612
+ TracedAssertions.fail((message === null ? "Expected value to be null." : message), null);
613
+ }
614
+ }
615
+ static assertNotNullRendered(wasNotNull, renderedActual, message) {
616
+ message = message ?? null;
617
+ TracedAssertions.recordEvent("not-null", [TracedAssertions.field("actual", renderedActual), TracedAssertions.msgField(message)]);
618
+ if (!wasNotNull) {
619
+ TracedAssertions.fail((message === null ? "Expected value to be non-null." : message), null);
620
+ }
621
+ }
622
+ static recordRenderedNotNull(renderedActual, message) {
623
+ message = message ?? null;
624
+ TracedAssertions.recordEvent("not-null", [TracedAssertions.field("actual", renderedActual), TracedAssertions.msgField(message)]);
625
+ }
626
+ static assertFailsWith(message, block) {
627
+ let caught = null;
628
+ let derived = false;
629
+ try {
630
+ try {
631
+ block();
632
+ }
633
+ catch (error) {
634
+ if (error instanceof IllegalStateException) {
635
+ caught = error;
636
+ derived = true;
637
+ }
638
+ else {
639
+ throw error;
640
+ }
641
+ }
642
+ }
643
+ catch (error) {
644
+ if (error instanceof TiqianIllegalArgumentException) {
645
+ caught = error;
646
+ derived = false;
647
+ }
648
+ else {
649
+ throw error;
650
+ }
651
+ }
652
+ if (caught !== null) {
653
+ TracedAssertions.recordEvent("raises", [TracedAssertions.field("exception", (derived ? "IllegalStateException" : "TiqianIllegalArgumentException")), TracedAssertions.field("thrown", TestTraceRender.renderString(caught.message)), TracedAssertions.msgField((message))]);
654
+ return caught;
655
+ }
656
+ TracedAssertions.recordEvent("fail", [TracedAssertions.msgField((message))]);
657
+ throw new TraceAssertionException({ kind: "AssertionFailed", message: (message === null ? "Expected an exception." : message) });
658
+ }
659
+ static assertFailsWithNoSuchElement(message, block) {
660
+ try {
661
+ block();
662
+ }
663
+ catch (error) {
664
+ if (error instanceof TiqianNoSuchElementException) {
665
+ TracedAssertions.recordEvent("raises", [TracedAssertions.field("exception", "TiqianNoSuchElementException"), TracedAssertions.field("thrown", TestTraceRender.renderString(error.message)), TracedAssertions.msgField((message))]);
666
+ return error;
667
+ }
668
+ else {
669
+ throw error;
670
+ }
671
+ }
672
+ TracedAssertions.recordEvent("fail", [TracedAssertions.msgField((message))]);
673
+ throw new TraceAssertionException({ kind: "AssertionFailed", message: (message === null ? "Expected an exception." : message) });
674
+ }
675
+ static fail(message, _cause) {
676
+ message = message ?? null;
677
+ _cause = _cause ?? null;
678
+ const text = message ?? "Assertion failed.";
679
+ TracedAssertions.recordEvent("fail", [TracedAssertions.msgField(message)]);
680
+ throw new TraceAssertionException({ kind: "AssertionFailed", message: text });
681
+ }
682
+ static assertDoesNotThrow(block) {
683
+ const result = block();
684
+ TracedAssertions.recordEvent("no-throw", []);
685
+ return result;
686
+ }
687
+ static recordEvent(name, fields) {
688
+ if (!TestTrace.updateMode) {
689
+ return;
690
+ }
691
+ let line = [];
692
+ const tail36 = line.length > 0 ? line[line.length - 1].charCodeAt(line[line.length - 1].length - 1) : NaN;
693
+ if (tail36 >= 55296 && tail36 <= 56319 && name.length > 0 && !(name.charCodeAt(0) >= 56320 && name.charCodeAt(0) <= 57343)) {
694
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail36 });
695
+ }
696
+ if (name.length > 0) {
697
+ line.push(name);
698
+ }
699
+ let index = 0;
700
+ while (index < fields.length) {
701
+ const current = fields[index];
702
+ if (current !== null) {
703
+ const tail37 = line.length > 0 ? line[line.length - 1].charCodeAt(line[line.length - 1].length - 1) : NaN;
704
+ if (tail37 >= 55296 && tail37 <= 56319) {
705
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail37 });
706
+ }
707
+ line.push(" ");
708
+ const tail38 = line.length > 0 ? line[line.length - 1].charCodeAt(line[line.length - 1].length - 1) : NaN;
709
+ if (tail38 >= 55296 && tail38 <= 56319 && current.key.length > 0 && !(current.key.charCodeAt(0) >= 56320 && current.key.charCodeAt(0) <= 57343)) {
710
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail38 });
711
+ }
712
+ if (current.key.length > 0) {
713
+ line.push(current.key);
714
+ }
715
+ const tail39 = line.length > 0 ? line[line.length - 1].charCodeAt(line[line.length - 1].length - 1) : NaN;
716
+ if (tail39 >= 55296 && tail39 <= 56319) {
717
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail39 });
718
+ }
719
+ line.push("=");
720
+ const tail40 = line.length > 0 ? line[line.length - 1].charCodeAt(line[line.length - 1].length - 1) : NaN;
721
+ if (tail40 >= 55296 && tail40 <= 56319 && TestTraceRender.canonicalNumbers(current.value).length > 0 && !(TestTraceRender.canonicalNumbers(current.value).charCodeAt(0) >= 56320 && TestTraceRender.canonicalNumbers(current.value).charCodeAt(0) <= 57343)) {
722
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail40 });
723
+ }
724
+ if (TestTraceRender.canonicalNumbers(current.value).length > 0) {
725
+ line.push(TestTraceRender.canonicalNumbers(current.value));
726
+ }
727
+ }
728
+ index += 1;
729
+ }
730
+ const tail41 = line.length > 0 ? line[line.length - 1].charCodeAt(line[line.length - 1].length - 1) : NaN;
731
+ if (tail41 >= 55296 && tail41 <= 56319) {
732
+ throw new UStringException({ kind: "UnpairedSurrogate", unit: tail41 });
733
+ }
734
+ const rendered = line.join("");
735
+ const recorder = TestTrace.currentRecorder();
736
+ if (recorder !== null) {
737
+ recorder.record(rendered);
738
+ }
739
+ }
740
+ static field(key, value) {
741
+ return { key, value };
742
+ }
743
+ static msgField(message) {
744
+ if (message === null) {
745
+ return null;
746
+ }
747
+ return TracedAssertions.field("msg", `'${TestTraceRender.escapeOperand((message))}'`);
748
+ }
749
+ }