1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10:08 +02:00

Speed up nginx parsing

This commit is contained in:
2022-03-15 18:16:28 +01:00
parent a0e7aec228
commit ca8f5a8fbe
5 changed files with 62 additions and 26 deletions

View File

@ -1,5 +1,5 @@
//
// NginxParserTest.swift
// NginxConfigParserTest.swift
// phpmon-tests
//
// Created by Nico Verbruggen on 29/11/2021.
@ -8,7 +8,7 @@
import XCTest
class NginxParserTest: XCTestCase {
class NginxConfigParserTest: XCTestCase {
static var regularUrl: URL {
return Bundle(for: Self.self).url(forResource: "nicoverbruggen", withExtension: "test")!
@ -19,8 +19,14 @@ class NginxParserTest: XCTestCase {
}
func testCanDetermineIsolation() throws {
XCTAssertNil(ValetSite.isolatedVersion(NginxParserTest.regularUrl.path))
XCTAssertEqual("8.1", ValetSite.isolatedVersion(NginxParserTest.isolatedUrl.path))
XCTAssertNil(
NginxConfigParser(filePath: NginxConfigParserTest.regularUrl.path).isolatedVersion()
)
XCTAssertEqual(
"8.1",
NginxConfigParser(filePath: NginxConfigParserTest.isolatedUrl.path).isolatedVersion()
)
}
}