<commit_before>﻿using System;
using System.Linq;
using NUnit.Framework;
using SoundUtils;

namespace UnitTest
{
    [TestFixture]
    public class ChannelTest
    {
        [Test]
        public void SplitTest()
        {
            var src0 = Enumerable.Range(0, 8).ToArray();
            var lch = new int[4];
            var rch = new int[4];

            Channel.Split(src0, lch, rch);

            Assert.That(lch, Is.EqualTo(new[] { 0, 2, 4, 6 }));
            Assert.That(rch, Is.EqualTo(new[] { 1, 3, 5, 7 }));
        }

        [Test]
        public void JoinTest()
        {
            var lch = Enumerable.Range(0, 4).ToArray();
            var rch = Enumerable.Range(4, 4).ToArray();
            var dst0 = new int[8];

            Channel.Join(lch, rch, dst0);
            
            Assert.That(dst0, Is.EqualTo(new[] { 0, 4, 1, 5, 2, 6, 3, 7 }));
        }

        [Test]
        public void InterleaveTest1()
        {
            var src = Enumerable.Range(0, 4).ToArray();
            var dst = new int[8];

            Channel.Interleave(src, dst, 4);
            
            Assert.That(dst, Is.EqualTo(new[] { 0, 0, 1, 0, 2, 0, 3, 0 }));

            Array.Clear(dst, 0, 8);
            Channel.Interleave(src, 2, dst, 0, 2);<commit_msg>:shirt: 適切な変数名をつける<commit_after>﻿using System;
using System.Linq;
using NUnit.Framework;
using SoundUtils;

namespace UnitTest
{
    [TestFixture]
    public class ChannelTest
    {
        [Test]
        public void SplitTest()
        {
            var src = Enumerable.Range(0, 8).ToArray();
            var lch = new int[4];
            var rch = new int[4];

            Channel.Split(src, lch, rch);

            Assert.That(lch, Is.EqualTo(new[] { 0, 2, 4, 6 }));
            Assert.That(rch, Is.EqualTo(new[] { 1, 3, 5, 7 }));
        }

        [Test]
        public void JoinTest()
        {
            var lch = Enumerable.Range(0, 4).ToArray();
            var rch = Enumerable.Range(4, 4).ToArray();
            var dst = new int[8];

            Channel.Join(lch, rch, dst);
            
            Assert.That(dst, Is.EqualTo(new[] { 0, 4, 1, 5, 2, 6, 3, 7 }));
        }

        [Test]
        public void InterleaveTest1()
        {
            var src = Enumerable.Range(0, 4).ToArray();
            var dst = new int[8];

            Channel.Interleave(src, dst, 4);
            
            Assert.That(dst, Is.EqualTo(new[] { 0, 0, 1, 0, 2, 0, 3, 0 }));

            Array.Clear(dst, 0, 8);
            Channel.Interleave(src, 2, dst, 0, 2);
{'fraction_non_alphanumeric': 0.14545454545454545, 'fraction_numerical': 0.03596837944664032, 'mean_word_length': 1.5773930753564154, 'pattern_counts': {'":': 0, '<': 3, '<?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': '775815', 'n_tokens_mistral': 916, 'n_tokens_neox': 841, 'n_words': 214}