@@ -8,26 +8,27 @@ features: [Temporal]
88---*/
99
1010const tests = [
11- [ new Temporal . PlainDateTime ( 1976 , 2 , 18 , 15 , 23 , 30 , 123 , 456 , 789 ) , 29 ] ,
12- [ new Temporal . PlainDateTime ( 1976 , 11 , 18 , 15 , 23 , 30 , 123 , 456 , 789 ) , 30 ] ,
13- [ new Temporal . PlainDateTime ( 1976 , 12 , 18 , 15 , 23 , 30 , 123 , 456 , 789 ) , 31 ] ,
14- [ new Temporal . PlainDateTime ( 1977 , 2 , 18 , 15 , 23 , 30 , 123 , 456 , 789 ) , 28 ] ,
11+ [ 1976 , 2 , 18 , 15 , 23 , 30 , 29 ] ,
12+ [ 1976 , 11 , 18 , 15 , 23 , 30 , 30 ] ,
13+ [ 1976 , 12 , 18 , 15 , 23 , 30 , 31 ] ,
14+ [ 1977 , 2 , 18 , 15 , 23 , 30 , 28 ] ,
15+ [ 1997 , 1 , 23 , 5 , 30 , 13 , 31 ] ,
16+ [ 1996 , 2 , 23 , 5 , 30 , 13 , 29 ] ,
17+ [ 2000 , 2 , 23 , 5 , 30 , 13 , 29 ] ,
18+ [ 1997 , 2 , 23 , 5 , 30 , 13 , 28 ] ,
19+ [ 1997 , 3 , 23 , 5 , 30 , 13 , 31 ] ,
20+ [ 1997 , 4 , 23 , 5 , 30 , 13 , 30 ] ,
21+ [ 1997 , 5 , 23 , 5 , 30 , 13 , 31 ] ,
22+ [ 1997 , 6 , 23 , 5 , 30 , 13 , 30 ] ,
23+ [ 1997 , 7 , 23 , 5 , 30 , 13 , 31 ] ,
24+ [ 1997 , 8 , 23 , 5 , 30 , 13 , 31 ] ,
25+ [ 1997 , 9 , 23 , 5 , 30 , 13 , 30 ] ,
26+ [ 1997 , 10 , 23 , 5 , 30 , 13 , 31 ] ,
27+ [ 1997 , 11 , 23 , 5 , 30 , 13 , 30 ] ,
28+ [ 1997 , 12 , 23 , 5 , 30 , 13 , 31 ] ,
1529] ;
16- for ( const [ plainDateTime , expected ] of tests ) {
30+ for ( const [ year , month , day , hour , minute , second , expected ] of tests ) {
31+ const plainDateTime = new Temporal . PlainDateTime ( year , month , day , hour , minute , second , 123 , 456 , 789 ) ;
1732 assert . sameValue ( plainDateTime . daysInMonth , expected , `${ expected } days in the month of ${ plainDateTime } ` ) ;
1833}
1934
20- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 1 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 31 ) ;
21- assert . sameValue ( ( new Temporal . PlainDateTime ( 1996 , 2 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 29 ) ;
22- assert . sameValue ( ( new Temporal . PlainDateTime ( 2000 , 2 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 29 ) ;
23- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 2 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 28 ) ;
24- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 3 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 31 ) ;
25- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 4 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 30 ) ;
26- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 5 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 31 ) ;
27- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 6 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 30 ) ;
28- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 7 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 31 ) ;
29- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 8 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 31 ) ;
30- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 9 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 30 ) ;
31- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 10 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 31 ) ;
32- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 11 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 30 ) ;
33- assert . sameValue ( ( new Temporal . PlainDateTime ( 1997 , 12 , 23 , 5 , 30 , 13 ) ) . daysInMonth , 31 ) ;
0 commit comments