LibWeb: Add test for week_number_of_the_last_day microsyntax

This commit is contained in:
stelar7 2023-12-11 15:37:26 +01:00 committed by Andrew Kaster
parent 479c48643e
commit dd391d5e8c
Notes: sideshowbarker 2024-07-17 01:13:25 +09:00
2 changed files with 25 additions and 0 deletions

View file

@ -2,6 +2,7 @@ set(TEST_SOURCES
TestCSSIDSpeed.cpp
TestCSSPixels.cpp
TestHTMLTokenizer.cpp
TestMicrosyntax.cpp
TestMimeSniff.cpp
TestNumbers.cpp
)

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2023, stelar7 <dudedbz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibTest/TestCase.h>
#include <LibWeb/HTML/Dates.h>
TEST_CASE(week_number_of_the_last_day)
{
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(1998), (u32)53);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(1999), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2000), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2001), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2002), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2003), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2004), (u32)53);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2005), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2006), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2007), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2008), (u32)52);
EXPECT_EQ(Web::HTML::week_number_of_the_last_day(2009), (u32)53);
}