<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NFluent;
using PygmentSharp.Core;
using PygmentSharp.Core.Lexers;
using Xunit;

namespace PygmentSharp.UnitTests
{
    public class LexerLocatorTests
    {
        [Fact]
        public void FindByName_SearchesAttributeName()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByName("C#");

            Check.That(lexer).IsInstanceOf<CSharpLexer>();
        }

        [Fact]
        public void FindByName_SearchesAlternateNames()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByName("c-sharp");

            Check.That(lexer).IsInstanceOf<CSharpLexer>();
        }

        [Fact]
        public void FindByName_ReturnsNullForNotFound()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByName("hotpotato");

            Check.That(lexer).IsNull();
        }

        [Fact]
        public void FindByFilename_SearchesForFileExtensions()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByFilename("file.cs");

            Check.That(lexer).IsInstanceOf<CSharpLexer>();
        }

        [Fact]
        public void FindByFilename_RetusnNullForNotFound()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByFilename("*.trump");

            Check.That(lexer).IsNull();
        }
    }
}
<commit_msg>Extra tests to ensure lexerlocator finds sqllexer<commit_after>﻿using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NFluent;
using PygmentSharp.Core;
using PygmentSharp.Core.Lexers;
using Xunit;

namespace PygmentSharp.UnitTests
{
    public class LexerLocatorTests
    {
        [Theory]
        [InlineData("C#", typeof(CSharpLexer))]
        [InlineData("SQL", typeof(SqlLexer))]
        public void FindByName_SearchesAttributeName(string name, Type lexerType)
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByName(name);

            Check.That(lexer.GetType()).IsEqualTo(lexerType);
        }

        [Fact]
        public void FindByName_SearchesAlternateNames()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByName("c-sharp");

            Check.That(lexer).IsInstanceOf<CSharpLexer>();
        }

        [Fact]
        public void FindByName_ReturnsNullForNotFound()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByName("hotpotato");

            Check.That(lexer).IsNull();
        }

        [Theory]
        [InlineData("file.cs", typeof(CSharpLexer))]
        [InlineData("bigdata.sql", typeof(SqlLexer))]
        public void FindByFilename_SearchesForFileExtensions(string file, Type lexerType)
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByFilename(file);

            Check.That(lexer.GetType()).IsEqualTo(lexerType);
        }

        [Fact]
        public void FindByFilename_RetusnNullForNotFound()
        {
            var subject = new LexerLocator();

            var lexer = subject.FindByFilename("*.trump");

            Check.That(lexer).IsNull();
        }
    }
}

{'fraction_non_alphanumeric': 0.09941192943153178, 'fraction_numerical': 0.0, 'mean_word_length': 1.981636060100167, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3138043', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1011, 'n_words': 188}