<commit_before>// Copyright 2012 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.

using System.Collections.Generic;
using System.Linq;
using NodaTime.Properties;
using NodaTime.Text;
using NUnit.Framework;

namespace NodaTime.Test.Text
{
    public static partial class PeriodPatternTest
    {
        [TestFixture]
        public class PeriodPatternNormalizingIsoTest : PatternTestBase<Period>
        {
            internal static readonly Data[] InvalidPatternData = {};

            internal static readonly Data[] ParseFailureData = {
                new Data { Text = "X5H", Message = Messages.Parse_MismatchedCharacter, Parameters = { 'P' } },
                new Data { Text = "", Message = Messages.Parse_ValueStringEmpty },
                new Data { Text = "P5J", Message = Messages.Parse_InvalidUnitSpecifier, Parameters = { 'J' } },
                new Data { Text = "P5D10M", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'M' } },
                new Data { Text = "P6M5D6D", Message = Messages.Parse_RepeatedUnitSpecifier, Parameters = { 'D' } },
                new Data { Text = "PT5M10H", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'H' } },
                new Data { Text = "P5H", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'H' } },
                new Data { Text = "PT5Y", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'Y' } },
                // Invalid in ISO.
                new Data { Text = "P", Message = Messages.Parse_EmptyPeriod },
                new Data { Text = "PX", Message = Messages.Parse_MissingNumber },
                new Data { Text = "P10M-", Message = Messages.Parse_EndOfString },
                new Data { Text = "P5", Message = Messages.Parse_EndOfString },
                new Data { Text = "PT9223372036854775808H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "9223372036854775808", typeof(Period) } },
                new Data { Text = "PT-9223372036854775809H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "-9223372036854775809", typeof(Period) } },
                new Data { Text = "PT10000000000000000000H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "10000000000000000000", typeof(Period) } },
                new Data { Text = "PT-10000000000000000000H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "-10000000000000000000", typeof(Period) } },
                new Data { Text = "P5.5S", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { '.' } },
                new Data { Text = "PT.5S", Message = Messages.Parse_MissingNumber },
                new Data { Text = "PT0.5X", Message = Messages.Parse_MismatchedCharacter, Parameters = { 'S' } },
                new Data { Text = "PT5S0.5S", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { '.' } },
                new Data { Text = "PT5.", Message = Messages.Parse_MissingNumber },
                new Data { Text = "PT5.5SX", Message = Messages.Parse_ExpectedEndOfString }
            };

            internal static readonly Data[] ParseOnlyData = {<commit_msg>Add a file that should have been in the last commit :)<commit_after>// Copyright 2012 The Noda Time Authors. All rights reserved.
// Use of this source code is governed by the Apache License 2.0,
// as found in the LICENSE.txt file.

using System.Collections.Generic;
using System.Linq;
using NodaTime.Properties;
using NodaTime.Text;
using NUnit.Framework;

namespace NodaTime.Test.Text
{
    public static partial class PeriodPatternTest
    {
        [TestFixture]
        public class PeriodPatternNormalizingIsoTest : PatternTestBase<Period>
        {
            // Single null value to keep it from being "inconclusive"
            internal static readonly Data[] InvalidPatternData = { null };

            internal static readonly Data[] ParseFailureData = {
                new Data { Text = "X5H", Message = Messages.Parse_MismatchedCharacter, Parameters = { 'P' } },
                new Data { Text = "", Message = Messages.Parse_ValueStringEmpty },
                new Data { Text = "P5J", Message = Messages.Parse_InvalidUnitSpecifier, Parameters = { 'J' } },
                new Data { Text = "P5D10M", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'M' } },
                new Data { Text = "P6M5D6D", Message = Messages.Parse_RepeatedUnitSpecifier, Parameters = { 'D' } },
                new Data { Text = "PT5M10H", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'H' } },
                new Data { Text = "P5H", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'H' } },
                new Data { Text = "PT5Y", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { 'Y' } },
                // Invalid in ISO.
                new Data { Text = "P", Message = Messages.Parse_EmptyPeriod },
                new Data { Text = "PX", Message = Messages.Parse_MissingNumber },
                new Data { Text = "P10M-", Message = Messages.Parse_EndOfString },
                new Data { Text = "P5", Message = Messages.Parse_EndOfString },
                new Data { Text = "PT9223372036854775808H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "9223372036854775808", typeof(Period) } },
                new Data { Text = "PT-9223372036854775809H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "-9223372036854775809", typeof(Period) } },
                new Data { Text = "PT10000000000000000000H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "10000000000000000000", typeof(Period) } },
                new Data { Text = "PT-10000000000000000000H", Message = Messages.Parse_ValueOutOfRange, Parameters = { "-10000000000000000000", typeof(Period) } },
                new Data { Text = "P5.5S", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { '.' } },
                new Data { Text = "PT.5S", Message = Messages.Parse_MissingNumber },
                new Data { Text = "PT0.5X", Message = Messages.Parse_MismatchedCharacter, Parameters = { 'S' } },
                new Data { Text = "PT5S0.5S", Message = Messages.Parse_MisplacedUnitSpecifier, Parameters = { '.' } },
                new Data { Text = "PT5.", Message = Messages.Parse_MissingNumber },
                new Data { Text = "PT5.5SX", Message = Messages.Parse_ExpectedEndOfString }
            };

            internal static readonly Data[] ParseOnlyData = {
{'fraction_non_alphanumeric': 0.11062148609633794, 'fraction_numerical': 0.05743807931925239, 'mean_word_length': 2.644518272425249, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7148179', 'n_tokens_mistral': 2114, 'n_tokens_neox': 1821, 'n_words': 479}