@@ -46,12 +46,8 @@ import Partial.Unsafe as Unsafe
46
46
import Test.Assert.Extended as Test
47
47
import Unsafe.Coerce as Unsafe.Coerce
48
48
49
- foreign import _polyfill :: Effect Unit
50
-
51
49
main :: Effect Unit
52
50
main = do
53
- _polyfill
54
-
55
51
test_Intl
56
52
57
53
test_Collator
@@ -63,7 +59,6 @@ main = do
63
59
test_PluralRules
64
60
test_RelativeTimeFormat
65
61
test_Segmenter
66
- test_DurationFormat
67
62
68
63
test_LocaleSensitive
69
64
@@ -984,68 +979,70 @@ unsafeParseDateTime :: String -> Effect DateTime
984
979
unsafeParseDateTime string = Unsafe .unsafePartial do
985
980
Maybe .fromJust <<< JSDate .toDateTime <$> JSDate .parse string
986
981
987
- test_DurationFormat :: Effect Unit
988
- test_DurationFormat = do
989
- en_US <- Locale .new_ " en-US"
990
-
991
- Console .log " DurationFormat.supportedLocalesOf"
992
- Test .assertEqual
993
- { actual: DurationFormat .supportedLocalesOf [ en_US ] { localeMatcher: " best fit" }
994
- , expected: [ " en-US" ]
995
- }
996
-
997
- Console .log " DurationFormat.supportedLocalesOf_"
998
- Test .assertEqual
999
- { actual: DurationFormat .supportedLocalesOf_ [ en_US ]
1000
- , expected: [ " en-US" ]
1001
- }
1002
-
1003
- format <- DurationFormat .new [ en_US ] { numberingSystem: " latn" , fractionalDigits: 0 }
1004
-
1005
- Console .log " DurationFormat.format"
1006
- Test .assertEqual
1007
- { actual: DurationFormat .format format { milliseconds: 1.0 }
1008
- , expected: " 1 ms"
1009
- }
1010
-
1011
- Console .log " DurationFormat.formatToParts"
1012
- Test .assertEqual
1013
- { actual: DurationFormat .formatToParts format { days: 1.0 }
1014
- , expected:
1015
- [ { type: " integer" , value: " 1" }
1016
- , { type: " literal" , value: " " }
1017
- , { type: " unit" , value: " day" }
1018
- ]
1019
- }
982
+ -- TODO: Not yet supported in Node
1020
983
1021
- Console .log " DurationFormat.resolvedOptions"
1022
- resolvedOptions <- DurationFormat .resolvedOptions format
1023
- Test .assertEqual
1024
- { actual: resolvedOptions
1025
- , expected:
1026
- { locale: " en"
1027
- , style: " short"
1028
- , years: " short"
1029
- , yearsDisplay: " auto"
1030
- , months: " short"
1031
- , monthsDisplay: " auto"
1032
- , weeks: " short"
1033
- , weeksDisplay: " auto"
1034
- , days: " short"
1035
- , daysDisplay: " auto"
1036
- , hours: " short"
1037
- , hoursDisplay: " auto"
1038
- , minutes: " short"
1039
- , minutesDisplay: " auto"
1040
- , seconds: " short"
1041
- , secondsDisplay: " auto"
1042
- , milliseconds: " short"
1043
- , millisecondsDisplay: " auto"
1044
- , microseconds: " short"
1045
- , microsecondsDisplay: " auto"
1046
- , nanoseconds: " short"
1047
- , nanosecondsDisplay: " auto"
1048
- , numberingSystem: " latn"
1049
- , fractionalDigits: 0
1050
- }
1051
- }
984
+ -- test_DurationFormat :: Effect Unit
985
+ -- test_DurationFormat = do
986
+ -- en_US <- Locale.new_ "en-US"
987
+
988
+ -- Console.log "DurationFormat.supportedLocalesOf"
989
+ -- Test.assertEqual
990
+ -- { actual: DurationFormat.supportedLocalesOf [ en_US ] { localeMatcher: "best fit" }
991
+ -- , expected: [ "en-US" ]
992
+ -- }
993
+
994
+ -- Console.log "DurationFormat.supportedLocalesOf_"
995
+ -- Test.assertEqual
996
+ -- { actual: DurationFormat.supportedLocalesOf_ [ en_US ]
997
+ -- , expected: [ "en-US" ]
998
+ -- }
999
+
1000
+ -- format <- DurationFormat.new [ en_US ] { numberingSystem: "latn", fractionalDigits: 0 }
1001
+
1002
+ -- Console.log "DurationFormat.format"
1003
+ -- Test.assertEqual
1004
+ -- { actual: DurationFormat.format format { milliseconds: 1.0 }
1005
+ -- , expected: "1 ms"
1006
+ -- }
1007
+
1008
+ -- Console.log "DurationFormat.formatToParts"
1009
+ -- Test.assertEqual
1010
+ -- { actual: DurationFormat.formatToParts format { days: 1.0 }
1011
+ -- , expected:
1012
+ -- [ { type: "integer", value: "1" }
1013
+ -- , { type: "literal", value: " " }
1014
+ -- , { type: "unit", value: "day" }
1015
+ -- ]
1016
+ -- }
1017
+
1018
+ -- Console.log "DurationFormat.resolvedOptions"
1019
+ -- resolvedOptions <- DurationFormat.resolvedOptions format
1020
+ -- Test.assertEqual
1021
+ -- { actual: resolvedOptions
1022
+ -- , expected:
1023
+ -- { locale: "en"
1024
+ -- , style: "short"
1025
+ -- , years: "short"
1026
+ -- , yearsDisplay: "auto"
1027
+ -- , months: "short"
1028
+ -- , monthsDisplay: "auto"
1029
+ -- , weeks: "short"
1030
+ -- , weeksDisplay: "auto"
1031
+ -- , days: "short"
1032
+ -- , daysDisplay: "auto"
1033
+ -- , hours: "short"
1034
+ -- , hoursDisplay: "auto"
1035
+ -- , minutes: "short"
1036
+ -- , minutesDisplay: "auto"
1037
+ -- , seconds: "short"
1038
+ -- , secondsDisplay: "auto"
1039
+ -- , milliseconds: "short"
1040
+ -- , millisecondsDisplay: "auto"
1041
+ -- , microseconds: "short"
1042
+ -- , microsecondsDisplay: "auto"
1043
+ -- , nanoseconds: "short"
1044
+ -- , nanosecondsDisplay: "auto"
1045
+ -- , numberingSystem: "latn"
1046
+ -- , fractionalDigits: 0
1047
+ -- }
1048
+ -- }
0 commit comments