forked from rebolsource/r3
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT: enabling T as a delimiter between date and time and Z as a zero…
… timezone, so subset of ISO8601 datetime values are loadable from Rebol. Example: ``` >> 2013-11-08T17:01 == 8-Nov-2013/17:01 >> 2013-11-08T17:01+0100 == 8-Nov-2013/17:01+1:00 >> 2013-11-08T17:01Z == 8-Nov-2013/17:01 ``` Related issues: metaeducation/rebol-issues#438 metaeducation/rebol-issues#2089 metaeducation/rebol-issues#2092
- Loading branch information
Showing
4 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Rebol [ | ||
Title: "Rebol3 date test script" | ||
Author: "Oldes, Peter W A Wood" | ||
File: %date-test.r3 | ||
Tabs: 4 | ||
Needs: [%../quick-test-module.r3] | ||
] | ||
|
||
~~~start-file~~~ "date" | ||
|
||
===start-group=== "ISO88601 subset" | ||
--test-- "ISO88601 basic load" | ||
--assert 8-Nov-2013/17:01 = load "2013-11-08T17:01" | ||
--assert 8-Nov-2013/17:01 = load "2013-11-08T17:01Z" | ||
--assert 8-Nov-2013/17:01+1:00 = load "2013-11-08T17:01+0100" | ||
--assert 8-Nov-2013/17:01-1:00 = load "2013-11-08T17:01-0100" | ||
--assert 8-Nov-2013/17:01+1:00 = load "2013-11-08T17:01+01:00" | ||
--test-- "basic load of not fully standard ISO88601" | ||
--assert 8-Nov-2013/17:01 = load "2013/11/08T17:01" | ||
--assert 8-Nov-2013/17:01 = load "2013/11/08T17:01Z" | ||
--assert 8-Nov-2013/17:01+1:00 = load "2013/11/08T17:01+0100" | ||
--assert 8-Nov-2013/17:01+1:00 = load "2013/11/08T17:01+01:00" | ||
--test-- "Invalid ISO88601 dates" | ||
--assert error? try [load "2013-11-08T17:01Z0100"] | ||
--assert error? try [load "2013/11/08T17:01Z0100"] | ||
|
||
--test-- "Using ISO88601 datetime in a path" | ||
;@@ https://github.com/rebol/rebol-issues/issues/2089 | ||
b: [8-Nov-2013/17:01 "foo"] | ||
--assert "foo" = b/2013-11-08T17:01 | ||
|
||
===end-group=== | ||
|
||
|
||
===end-group=== | ||
|
||
~~~end-file~~~ |