@tiqian/engine 0.0.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.
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
- package/dist/org/tiqian/clreq/BopomofoParser.d.ts +10 -0
- package/dist/org/tiqian/clreq/BopomofoParser.js +46 -0
- package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
- package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
- package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
- package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.d.ts +8 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.js +25 -0
- package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
- package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.d.ts +10 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.js +13 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.d.ts +7 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.js +40 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.d.ts +19 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.js +93 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.d.ts +26 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.js +137 -0
- package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
- package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
- package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
- package/dist/org/tiqian/clreq/GlueSide.js +17 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
- package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
- package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
- package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
- package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.d.ts +8 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.js +56 -0
- package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
- package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.d.ts +10 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.js +18 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
- package/dist/org/tiqian/core/AccurateSum.d.ts +3 -0
- package/dist/org/tiqian/core/AccurateSum.js +9 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.js +33 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.js +17 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.d.ts +11 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.js +52 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.d.ts +4 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.js +5 -0
- package/dist/org/tiqian/core/Cluster.d.ts +13 -0
- package/dist/org/tiqian/core/Cluster.js +24 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/ColorSpan.d.ts +8 -0
- package/dist/org/tiqian/core/ColorSpan.js +25 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.js +47 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/DecorationKind.d.ts +20 -0
- package/dist/org/tiqian/core/DecorationKind.js +20 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.d.ts +15 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.js +28 -0
- package/dist/org/tiqian/core/DecorationSpan.d.ts +10 -0
- package/dist/org/tiqian/core/DecorationSpan.js +36 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.d.ts +9 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.js +29 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.d.ts +2 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.js +84 -0
- package/dist/org/tiqian/core/FontDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/FontDecisionInfo.js +45 -0
- package/dist/org/tiqian/core/Glyph.d.ts +15 -0
- package/dist/org/tiqian/core/Glyph.js +30 -0
- package/dist/org/tiqian/core/GlyphRun.d.ts +11 -0
- package/dist/org/tiqian/core/GlyphRun.js +28 -0
- package/dist/org/tiqian/core/Ic.d.ts +7 -0
- package/dist/org/tiqian/core/Ic.js +17 -0
- package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
- package/dist/org/tiqian/core/IllegalStateException.js +8 -0
- package/dist/org/tiqian/core/InlineAttachment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineAttachment.js +14 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.js +14 -0
- package/dist/org/tiqian/core/InlineBoxSpan.d.ts +10 -0
- package/dist/org/tiqian/core/InlineBoxSpan.js +17 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.js +31 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.d.ts +28 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.js +57 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.d.ts +11 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.js +30 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.js +17 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineObjectSpan.d.ts +13 -0
- package/dist/org/tiqian/core/InlineObjectSpan.js +22 -0
- package/dist/org/tiqian/core/IntRange.d.ts +12 -0
- package/dist/org/tiqian/core/IntRange.js +30 -0
- package/dist/org/tiqian/core/IntRangeFns.d.ts +2 -0
- package/dist/org/tiqian/core/IntRangeFns.js +4 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.js +18 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.js +21 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.d.ts +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.js +17 -0
- package/dist/org/tiqian/core/LayoutConstraints.d.ts +7 -0
- package/dist/org/tiqian/core/LayoutConstraints.js +24 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.d.ts +70 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.js +205 -0
- package/dist/org/tiqian/core/LayoutInput.d.ts +22 -0
- package/dist/org/tiqian/core/LayoutInput.js +56 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.d.ts +18 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.js +131 -0
- package/dist/org/tiqian/core/LayoutProfileId.d.ts +6 -0
- package/dist/org/tiqian/core/LayoutProfileId.js +17 -0
- package/dist/org/tiqian/core/LayoutQueries.d.ts +121 -0
- package/dist/org/tiqian/core/LayoutQueries.js +1297 -0
- package/dist/org/tiqian/core/LayoutQueryFns.d.ts +27 -0
- package/dist/org/tiqian/core/LayoutQueryFns.js +65 -0
- package/dist/org/tiqian/core/LayoutResult.d.ts +16 -0
- package/dist/org/tiqian/core/LayoutResult.js +36 -0
- package/dist/org/tiqian/core/LayoutResultFns.d.ts +3 -0
- package/dist/org/tiqian/core/LayoutResultFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.d.ts +4 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.d.ts +37 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.js +379 -0
- package/dist/org/tiqian/core/LineBox.d.ts +23 -0
- package/dist/org/tiqian/core/LineBox.js +43 -0
- package/dist/org/tiqian/core/LineBreakPolicy.d.ts +8 -0
- package/dist/org/tiqian/core/LineBreakPolicy.js +11 -0
- package/dist/org/tiqian/core/LineBreakSpan.d.ts +10 -0
- package/dist/org/tiqian/core/LineBreakSpan.js +30 -0
- package/dist/org/tiqian/core/LineDebugInfo.d.ts +7 -0
- package/dist/org/tiqian/core/LineDebugInfo.js +18 -0
- package/dist/org/tiqian/core/LineDecisionInfo.d.ts +14 -0
- package/dist/org/tiqian/core/LineDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
- package/dist/org/tiqian/core/LineEndReason.js +17 -0
- package/dist/org/tiqian/core/LineLengthGrid.d.ts +7 -0
- package/dist/org/tiqian/core/LineLengthGrid.js +12 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.js +26 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.d.ts +8 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.js +14 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.d.ts +16 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.js +30 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.d.ts +15 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.js +31 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.js +20 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.d.ts +3 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.js +12 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.js +25 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.d.ts +8 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.js +17 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.d.ts +19 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/ParagraphStyle.d.ts +22 -0
- package/dist/org/tiqian/core/ParagraphStyle.js +36 -0
- package/dist/org/tiqian/core/PositionedCluster.d.ts +22 -0
- package/dist/org/tiqian/core/PositionedCluster.js +52 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.d.ts +29 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/Rect.d.ts +12 -0
- package/dist/org/tiqian/core/Rect.js +28 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.d.ts +15 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.js +25 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.d.ts +16 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.js +17 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.d.ts +19 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.js +51 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.d.ts +12 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.js +28 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.d.ts +6 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.js +62 -0
- package/dist/org/tiqian/core/RichTextLinePattern.d.ts +24 -0
- package/dist/org/tiqian/core/RichTextLinePattern.js +46 -0
- package/dist/org/tiqian/core/RichTextLineSegment.d.ts +25 -0
- package/dist/org/tiqian/core/RichTextLineSegment.js +55 -0
- package/dist/org/tiqian/core/RichTextPaint.d.ts +17 -0
- package/dist/org/tiqian/core/RichTextPaint.js +64 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.d.ts +7 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.js +102 -0
- package/dist/org/tiqian/core/RichTextRole.d.ts +35 -0
- package/dist/org/tiqian/core/RichTextRole.js +57 -0
- package/dist/org/tiqian/core/RichTextSpan.d.ts +11 -0
- package/dist/org/tiqian/core/RichTextSpan.js +34 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.d.ts +12 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.js +41 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.d.ts +20 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.js +46 -0
- package/dist/org/tiqian/core/RubyKind.d.ts +12 -0
- package/dist/org/tiqian/core/RubyKind.js +14 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.d.ts +12 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.js +14 -0
- package/dist/org/tiqian/core/RubySpan.d.ts +13 -0
- package/dist/org/tiqian/core/RubySpan.js +60 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/Size.d.ts +6 -0
- package/dist/org/tiqian/core/Size.js +12 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/TextRange.d.ts +11 -0
- package/dist/org/tiqian/core/TextRange.js +40 -0
- package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
- package/dist/org/tiqian/core/TextRangeError.js +2 -0
- package/dist/org/tiqian/core/TextSpan.d.ts +8 -0
- package/dist/org/tiqian/core/TextSpan.js +12 -0
- package/dist/org/tiqian/core/TextStyle.d.ts +12 -0
- package/dist/org/tiqian/core/TextStyle.js +28 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
- package/dist/org/tiqian/core/TiqianTextContent.d.ts +12 -0
- package/dist/org/tiqian/core/TiqianTextContent.js +38 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
- package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
- package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
- package/dist/org/tiqian/core/Units.d.ts +7 -0
- package/dist/org/tiqian/core/Units.js +11 -0
- package/dist/org/tiqian/core/WritingMode.d.ts +12 -0
- package/dist/org/tiqian/core/WritingMode.js +14 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/font/BaselineClass.d.ts +24 -0
- package/dist/org/tiqian/font/BaselineClass.js +23 -0
- package/dist/org/tiqian/font/BaselinePolicy.d.ts +17 -0
- package/dist/org/tiqian/font/BaselinePolicy.js +18 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.d.ts +4 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.js +9 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.d.ts +8 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.js +43 -0
- package/dist/org/tiqian/font/FontMetricSource.d.ts +24 -0
- package/dist/org/tiqian/font/FontMetricSource.js +23 -0
- package/dist/org/tiqian/font/FontMetrics.d.ts +39 -0
- package/dist/org/tiqian/font/FontMetrics.js +106 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.js +21 -0
- package/dist/org/tiqian/font/FontPolicy.d.ts +36 -0
- package/dist/org/tiqian/font/FontPolicy.js +157 -0
- package/dist/org/tiqian/font/FontRole.d.ts +29 -0
- package/dist/org/tiqian/font/FontRole.js +27 -0
- package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
- package/dist/org/tiqian/font/FontRoleContext.js +28 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.d.ts +4 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.js +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.d.ts +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.js +29 -0
- package/dist/org/tiqian/font/MetricBox.d.ts +20 -0
- package/dist/org/tiqian/font/MetricBox.js +20 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.d.ts +10 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.js +30 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.js +21 -0
- package/dist/org/tiqian/font/RawFontMetrics.d.ts +11 -0
- package/dist/org/tiqian/font/RawFontMetrics.js +23 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.js +63 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.js +46 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.js +71 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.js +88 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.d.ts +57 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.js +622 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.d.ts +52 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.js +209 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.d.ts +30 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.js +215 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.d.ts +54 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.js +326 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.d.ts +6 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.js +8 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.d.ts +4 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.js +7 -0
- package/dist/org/tiqian/layout/Justifier.d.ts +64 -0
- package/dist/org/tiqian/layout/Justifier.js +474 -0
- package/dist/org/tiqian/layout/KinsokuRule.d.ts +15 -0
- package/dist/org/tiqian/layout/KinsokuRule.js +24 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.d.ts +87 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.js +371 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.d.ts +29 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.js +797 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.d.ts +149 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.js +769 -0
- package/dist/org/tiqian/layout/LineBreaker.d.ts +54 -0
- package/dist/org/tiqian/layout/LineBreaker.js +457 -0
- package/dist/org/tiqian/layout/LineGeometryStage.d.ts +63 -0
- package/dist/org/tiqian/layout/LineGeometryStage.js +344 -0
- package/dist/org/tiqian/layout/LineOptimization.d.ts +125 -0
- package/dist/org/tiqian/layout/LineOptimization.js +299 -0
- package/dist/org/tiqian/layout/LineRepair.d.ts +30 -0
- package/dist/org/tiqian/layout/LineRepair.js +471 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.d.ts +80 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.js +556 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.d.ts +23 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.js +135 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.d.ts +48 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.js +199 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.d.ts +63 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.js +1471 -0
- package/dist/org/tiqian/layout/PlanLowering.d.ts +10 -0
- package/dist/org/tiqian/layout/PlanLowering.js +329 -0
- package/dist/org/tiqian/layout/PreparedParagraph.d.ts +32 -0
- package/dist/org/tiqian/layout/PreparedParagraph.js +114 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.d.ts +92 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.js +617 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.d.ts +73 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.js +631 -0
- package/dist/org/tiqian/layout/PunctuationModel.d.ts +181 -0
- package/dist/org/tiqian/layout/PunctuationModel.js +414 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.d.ts +88 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.js +495 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.d.ts +102 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.js +1207 -0
- package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
- package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.d.ts +19 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.js +64 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.d.ts +5 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.js +14 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.d.ts +4 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.js +4294 -0
- package/dist/org/tiqian/linebreak/Hyphenator.d.ts +17 -0
- package/dist/org/tiqian/linebreak/Hyphenator.js +24 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.d.ts +10 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.js +67 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.d.ts +9 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.js +23 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.d.ts +2 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.js +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.d.ts +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.js +108 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.d.ts +6 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.js +9 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.d.ts +63 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.js +103 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.d.ts +3 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.js +164 -0
- package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
- package/dist/org/tiqian/protocol/NamedError.js +71 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
- package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
- package/dist/org/tiqian/protocol/Plan.js +10 -0
- package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
- package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
- package/dist/org/tiqian/protocol/PlanJson.d.ts +10 -0
- package/dist/org/tiqian/protocol/PlanJson.js +442 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
- package/dist/org/tiqian/protocol/PlanPacked.d.ts +34 -0
- package/dist/org/tiqian/protocol/PlanPacked.js +1166 -0
- package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
- package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.d.ts +48 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.js +97 -0
- package/dist/org/tiqian/shaping/TextShaper.d.ts +71 -0
- package/dist/org/tiqian/shaping/TextShaper.js +176 -0
- package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
- package/dist/org/tiqian/test/TestHelpers.js +27 -0
- package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
- package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceField.js +10 -0
- package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
- package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
- package/dist/runtime.d.ts +96 -0
- package/dist/runtime.js +1612 -0
- package/dist/std/FsError.d.ts +48 -0
- package/dist/std/FsError.js +2 -0
- package/dist/std/FsException.d.ts +6 -0
- package/dist/std/FsException.js +45 -0
- package/dist/std/UStringException.d.ts +6 -0
- package/dist/std/UStringException.js +21 -0
- package/dist/std/UStringFault.d.ts +9 -0
- package/dist/std/UStringFault.js +2 -0
- package/package.json +22 -4
- 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
|
+
}
|