<commit_before>﻿using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace Roaring
{
    public class Tests
    {        
        [Fact]
        public void TestAdd()
        {
            uint[] values = new uint[] { 1, 2, 3, 4, 5, 100, 1000 };
            uint max = values.Max() + 1;

            using (var rb1 = new RoaringBitmap())
            using (var rb2 = new RoaringBitmap())
            using (var rb3 = RoaringBitmap.FromValues(values))
            {
                for (int i = 0; i < values.Length; i++)
                    rb1.Add(values[i]);
                rb1.Optimize();

                rb2.Add(values);
                rb2.Optimize();

                rb3.Optimize();

                Assert.Equal(rb1.Cardinality, (uint)values.Length);
                Assert.Equal(rb2.Cardinality, (uint)values.Length);
                Assert.Equal(rb3.Cardinality, (uint)values.Length);

                for (uint i = 0; i < max; i++)<commit_msg>Fixed exception in tests<commit_after>﻿using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace CRoaring
{
    public class Tests
    {        
        [Fact]
        public void TestAdd()
        {
            uint[] values = new uint[] { 1, 2, 3, 4, 5, 100, 1000 };
            uint max = values.Max() + 1;

            using (var rb1 = new RoaringBitmap())
            using (var rb2 = new RoaringBitmap())
            using (var rb3 = RoaringBitmap.FromValues(values))
            {
                for (int i = 0; i < values.Length; i++)
                    rb1.Add(values[i]);
                rb1.Optimize();

                rb2.Add(values);
                rb2.Optimize();

                rb3.Optimize();

                Assert.Equal(rb1.Cardinality, (uint)values.Length);
                Assert.Equal(rb2.Cardinality, (uint)values.Length);
                Assert.Equal(rb3.Cardinality, (uint)values.Length);

                for (uint i = 0; i < max; i++)
{'fraction_non_alphanumeric': 0.12244897959183673, 'fraction_numerical': 0.026530612244897958, 'mean_word_length': 1.527061855670103, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '5654674', 'n_tokens_mistral': 623, 'n_tokens_neox': 558, 'n_words': 140}