Skip to content

Commit

Permalink
Add IETF's http state tests
Browse files Browse the repository at this point in the history
  • Loading branch information
inikulin committed Feb 27, 2015
1 parent b8aa8e8 commit 1af799c
Show file tree
Hide file tree
Showing 7 changed files with 2,736 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: node_js
node_js:
- "0.10"
- "0.11"
- "0.12"
- iojs
matrix:
fast_finish: true
allow_failures:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)

[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie)
[![Build Status](https://travis-ci.org/inikulin/tough-cookie.png?branch=master)](https://travis-ci.org/inikulin/tough-cookie)

[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)
![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"main": "./lib/cookie",
"scripts": {
"test": "vows test/*"
"test": "vows test/*_test.js"
},
"engines": {
"node": ">=0.4.12"
Expand Down
168 changes: 168 additions & 0 deletions test/ietf_data/dates/bsd-examples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
[
{
"test": "Sat, 15-Apr-17 21:01:22 GMT",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Thu, 19-Apr-2007 16:00:00 GMT",
"expected": "Thu, 19 Apr 2007 16:00:00 GMT"
}, {
"test": "Wed, 25 Apr 2007 21:02:13 GMT",
"expected": "Wed, 25 Apr 2007 21:02:13 GMT"
}, {
"test": "Thu, 19/Apr\\2007 16:00:00 GMT",
"expected": "Thu, 19 Apr 2007 16:00:00 GMT"
}, {
"test": "Fri, 1 Jan 2010 01:01:50 GMT",
"expected": "Fri, 01 Jan 2010 01:01:50 GMT"
}, {
"test": "Wednesday, 1-Jan-2003 00:00:00 GMT",
"expected": "Wed, 01 Jan 2003 00:00:00 GMT"
}, {
"test": ", 1-Jan-2003 00:00:00 GMT",
"expected": "Wed, 01 Jan 2003 00:00:00 GMT"
}, {
"test": " 1-Jan-2003 00:00:00 GMT",
"expected": "Wed, 01 Jan 2003 00:00:00 GMT"
}, {
"test": "1-Jan-2003 00:00:00 GMT",
"expected": "Wed, 01 Jan 2003 00:00:00 GMT"
}, {
"test": "Wed,18-Apr-07 22:50:12 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "WillyWonka , 18-Apr-07 22:50:12 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "WillyWonka , 18-Apr-07 22:50:12",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "WillyWonka , 18-apr-07 22:50:12",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Mon, 18-Apr-1977 22:50:13 GMT",
"expected": "Mon, 18 Apr 1977 22:50:13 GMT"
}, {
"test": "Mon, 18-Apr-77 22:50:13 GMT",
"expected": "Mon, 18 Apr 1977 22:50:13 GMT"
}, {
"test": "\"Sat, 15-Apr-17\\\"21:01:22\\\"GMT\"",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Partyday, 18- April-07 22:50:12",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Partyday, 18 - Apri-07 22:50:12",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Wednes, 1-Januar-2003 00:00:00 GMT",
"expected": "Wed, 01 Jan 2003 00:00:00 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 GMT-2",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 GMT BLAH",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 GMT-0400",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 DST",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 -0400",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 (hello there)",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 11:22:33",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 ::00 21:01:22",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 boink:z 21:01:22",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Sat, 15-Apr-17 91:22:33 21:01:22",
"expected": null
}, {
"test": "Thu Apr 18 22:50:12 2007 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "22:50:12 Thu Apr 18 2007 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Thu 22:50:12 Apr 18 2007 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Thu Apr 22:50:12 18 2007 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Thu Apr 18 22:50:12 2007 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Thu Apr 18 2007 22:50:12 GMT",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Thu Apr 18 2007 GMT 22:50:12",
"expected": "Wed, 18 Apr 2007 22:50:12 GMT"
}, {
"test": "Sat, 15-Apr-17 21:01:22 GMT",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "15-Sat, Apr-17 21:01:22 GMT",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "15-Sat, Apr 21:01:22 GMT 17",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "15-Sat, Apr 21:01:22 GMT 2017",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "15 Apr 21:01:22 2017",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "15 17 Apr 21:01:22",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Apr 15 17 21:01:22",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "Apr 15 21:01:22 17",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "2017 April 15 21:01:22",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "15 April 2017 21:01:22",
"expected": "Sat, 15 Apr 2017 21:01:22 GMT"
}, {
"test": "98 April 17 21:01:22",
"expected": null
}, {
"test": "Thu, 012-Aug-2008 20:49:07 GMT",
"expected": null
}, {
"test": "Thu, 12-Aug-31841 20:49:07 GMT",
"expected": null
}, {
"test": "Thu, 12-Aug-9999999999 20:49:07 GMT",
"expected": null
}, {
"test": "Thu, 999999999999-Aug-2007 20:49:07 GMT",
"expected": null
}, {
"test": "Thu, 12-Aug-2007 20:61:99999999999 GMT",
"expected": null
}, {
"test": "IAintNoDateFool",
"expected": null
}
]
48 changes: 48 additions & 0 deletions test/ietf_data/dates/examples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[
{
"test": "Mon, 10-Dec-2007 17:02:24 GMT",
"expected": "Mon, 10 Dec 2007 17:02:24 GMT"
}, {
"test": "Wed, 09 Dec 2009 16:27:23 GMT",
"expected": "Wed, 09 Dec 2009 16:27:23 GMT"
}, {
"test": "Thursday, 01-Jan-1970 00:00:00 GMT",
"expected": "Thu, 01 Jan 1970 00:00:00 GMT"
}, {
"test": "Mon Dec 10 16:32:30 2007 GMT",
"expected": "Mon, 10 Dec 2007 16:32:30 GMT"
}, {
"test": "Wednesday, 01-Jan-10 00:00:00 GMT",
"expected": "Fri, 01 Jan 2010 00:00:00 GMT"
}, {
"test": "Mon, 10-Dec-07 20:35:03 GMT",
"expected": "Mon, 10 Dec 2007 20:35:03 GMT"
}, {
"test": "Wed, 1 Jan 2020 00:00:00 GMT",
"expected": "Wed, 01 Jan 2020 00:00:00 GMT"
}, {
"test": "Saturday, 8-Dec-2012 21:24:09 GMT",
"expected": "Sat, 08 Dec 2012 21:24:09 GMT"
}, {
"test": "Thu, 31 Dec 23:55:55 2037 GMT",
"expected": "Thu, 31 Dec 2037 23:55:55 GMT"
}, {
"test": "Sun, 9 Dec 2012 13:42:05 GMT",
"expected": "Sun, 09 Dec 2012 13:42:05 GMT"
}, {
"test": "Wed Dec 12 2007 08:44:07 GMT-0500 (EST)",
"expected": "Wed, 12 Dec 2007 08:44:07 GMT"
}, {
"test": "Mon, 01-Jan-2011 00: 00:00 GMT",
"expected": null
}, {
"test": "Sun, 1-Jan-1995 00:00:00 GMT",
"expected": "Sun, 01 Jan 1995 00:00:00 GMT"
}, {
"test": "Wednesday, 01-Jan-10 0:0:00 GMT",
"expected": "Fri, 01 Jan 2010 00:00:00 GMT"
}, {
"test": "Thu, 10 Dec 2009 13:57:2 GMT",
"expected": "Thu, 10 Dec 2009 13:57:02 GMT"
}
]
Loading

0 comments on commit 1af799c

Please sign in to comment.