chromium/v8/test/unittests/temporal/temporal-parser-unittest.cc

// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/temporal/temporal-parser.h"

#include <optional>

#include "src/execution/isolate.h"
#include "src/heap/factory-inl.h"
#include "test/unittests/test-utils.h"

namespace v8 {
namespace internal {

// This file test the TemporalParser to parse ISO 8601 according to
// #sec-temporal-iso8601grammar

// For int32_t fields in ParsedISO8601Result, kMinInt31 denote 'undefined'
// value.
const int32_t kUndefined =;

void CheckCalendar(Isolate* isolate, Handle<String> iso_string,
                   int32_t calendar_start, int32_t calendar_length,
                   const std::string& expected_calendar) {}

void CheckDate(const ParsedISO8601Result& actual, int32_t date_year,
               int32_t date_month, int32_t date_day) {}

void CheckTime(const ParsedISO8601Result& actual, int32_t time_hour,
               int32_t time_minute, int32_t time_second,
               int32_t time_nanosecond) {}

void CheckTimeZoneNumericUTCOffset(const ParsedISO8601Result& actual,
                                   int32_t tzuo_sign, int32_t tzuo_hour,
                                   int32_t tzuo_minute, int32_t tzuo_second,
                                   int32_t tzuo_nanosecond) {}

void CheckDuration(const ParsedISO8601Duration& actual, int64_t sign,
                   int64_t years, int64_t months, int64_t weeks, int64_t days,
                   int64_t whole_hours, int64_t hours_fraction,
                   int64_t whole_minutes, int64_t minutes_fraction,
                   int64_t whole_seconds, int64_t seconds_fraction) {}

char commatoperiod(char in) {}

char asciitolower(char in) {}

#define IMPL_VERIFY_PARSE_TEMPORAL_DATE_STRING_SUCCESS(R)

#define IMPL_VERIFY_PARSE_TEMPORAL_DATE_TIME_STRING_SUCCESS(R)

#define IMPL_VERIFY_PARSE_TEMPORAL_ZONED_DATE_TIME_STRING_SUCCESS(R)

class TemporalParserTest : public TestWithIsolate {};

#define VERIFY_PARSE_FAIL(R, str)

#define VERIFY_PARSE_FAIL_ON_DATE(R)

TEST_F(TemporalParserTest, TemporalTimeStringSuccess) {}

TEST_F(TemporalParserTest, TemporalTimeStringIllegal) {}

#define IMPL_DATE_TIME_STRING_SUCCESS(R)

TEST_F(TemporalParserTest, TemporalDateTimeStringSuccess) {}

TEST_F(TemporalParserTest, TemporalDateTimeStringIllegal) {}

TEST_F(TemporalParserTest, TemporalYearMonthStringSuccess) {}

TEST_F(TemporalParserTest, TemporalYearMonthStringIllegal) {}

TEST_F(TemporalParserTest, TemporalMonthDayStringSuccess) {}

TEST_F(TemporalParserTest, TemporalMonthDayStringIllegal) {}

TEST_F(TemporalParserTest, TemporalInstantStringSuccess) {}

TEST_F(TemporalParserTest, TemporalInstantStringIllegal) {}

#define IMPL_ZONED_DATE_TIME_STRING_SUCCESS(R)

TEST_F(TemporalParserTest, TemporalZonedDateTimeStringSuccess) {}

#define VERIFY_PARSE_FAIL_ON_ZONED_DATE_TIME(R)

TEST_F(TemporalParserTest, TemporalZonedDateTimeStringIllegal) {}

constexpr int64_t empty =;

// Test basic cases.
TEST_F(TemporalParserTest, TemporalDurationStringBasic) {}

// Test duration with ascii minus sign parsed correctly.
TEST_F(TemporalParserTest, TemporalDurationStringNegative) {}

// Test duration with + sign parsed the same as without + sign.
TEST_F(TemporalParserTest, TemporalDurationStringPlus) {}

// Test duration with Unicode U+2212 minus sign parsed the same as ascii - sign.
TEST_F(TemporalParserTest, TemporalDurationStringMinus) {}

// Test duration in lower case mark parsed the same as with upper case mark.
TEST_F(TemporalParserTest, TemporalDurationStringLowerCase) {}

TEST_F(TemporalParserTest, TemporalDurationStringComma) {}

TEST_F(TemporalParserTest, TemporalDurationStringLongDigits) {}

TEST_F(TemporalParserTest, TemporalDurationStringNotSatisfy) {}

TEST_F(TemporalParserTest, TimeZoneNumericUTCOffsetBasic) {}

TEST_F(TemporalParserTest, TimeZoneNumericUTCOffsetIllegal) {}

TEST_F(TemporalParserTest, TimeZoneIdentifierSucccess) {}
TEST_F(TemporalParserTest, TimeZoneIdentifierIllegal) {}

TEST_F(TemporalParserTest, CalendarNameSuccess) {}

TEST_F(TemporalParserTest, CalendarNameIllegal) {}

}  // namespace internal
}  // namespace v8