Skip to content

Commit

Permalink
Fix failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunkerley committed Sep 26, 2023
1 parent ad1ccea commit 81d9921
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion distribution/lib/Standard/Base/0.0.0-dev/src/Data.enso
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ from project.System.File_Format import Auto_Detect, File_Format
read : Text | File -> File_Format -> Problem_Behavior -> Any ! File_Error
read path format=Auto_Detect (on_problems=Problem_Behavior.Report_Warning) = case path of
_ : Text -> if (path.starts_with "http://") || (path.starts_with "https://") then fetch path else
read (File.new path)
read (File.new path) format on_problems
_ -> File.new path . read format on_problems

## ALIAS load text, open text
Expand Down
2 changes: 1 addition & 1 deletion test/Tests/src/Data/Json_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec =
deep_err.should_fail_parsing_with "closing quote ] expected at position 34"
"123 4".should_fail_parsing_with "JSON cannot be fully parsed at position 4"

Test.specify "should be able to deserialize Dates" <|
Test.specify "should be able to deserialize Date" <|
'{"type": "Date", "constructor": "new", "year": 2018, "month": 7, "day": 3}'.should_parse_as (Date.new 2018 7 3)
'{"type": "Date", "year": 2025, "month": 5, "day": 12}'.should_parse_as (Date.new 2025 5 12)
'{"type": "Date", "month": 5, "day": 12}' . should_parse_as (JS_Object.from_pairs [["type", "Date"], ["month", 5], ["day", 12]])
Expand Down
8 changes: 4 additions & 4 deletions test/Tests/src/Data/Time/Time_Zone_Spec.enso
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ spec =
Test.specify "should convert to Json" <|
zone = Time_Zone.new 1 2 3
zone.to_json.should_equal <|
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "new"], ["id", "+01:02:03"]] . to_text
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "parse"], ["id", "+01:02:03"]] . to_text
Time_Zone.utc.to_json.should_equal <|
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "new"], ["id", "UTC"]] . to_text
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "parse"], ["id", "UTC"]] . to_text
Test.specify "should throw error when parsing invalid zone id" <|
case Time_Zone.parse "foo" . catch of
Time_Error.Error msg _ ->
Expand Down Expand Up @@ -66,9 +66,9 @@ spec =
Test.specify "should convert to Json" <|
zone = ZoneOffset.ofHoursMinutesSeconds 1 2 3
zone.to_json.should_equal <|
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "new"], ["id", "+01:02:03"]] . to_text
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "parse"], ["id", "+01:02:03"]] . to_text
(ZoneId.of "UTC").to_json.should_equal <|
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "new"], ["id", "UTC"]] . to_text
JS_Object.from_pairs [["type", "Time_Zone"], ["constructor", "parse"], ["id", "UTC"]] . to_text
Test.specify "should correctly determine the type of zone" <|
zone = ZoneId.systemDefault
Meta.type_of zone . should_equal_type Time_Zone
Expand Down

0 comments on commit 81d9921

Please sign in to comment.