Skip to content

Commit

Permalink
Merge pull request #2 from vapor/warning
Browse files Browse the repository at this point in the history
add mismatched slug warning
  • Loading branch information
loganwright authored Oct 28, 2016
2 parents fff9b67 + 346ed79 commit b5b8dbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 50 deletions.
6 changes: 6 additions & 0 deletions Sources/Routing/Branch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ public class Branch<Output> { // TODO: Rename Context

let link = key.characters.first == ":" ? ":" : key
let next = subBranches[link] ?? type(of: self).init(name: key, output: nil)
if next.name != key {
var warning = "[WARNING] Mismatched Slugs:\n"
warning += "Attempted to overwrite \(next.name) with \(key)\n"
warning += "Please use the same slug name for all routes on shared branch"
print(warning)
}
next.parent = self
// trigger lazy loads at extension time -- seek out cleaner way to do this
_ = next.path
Expand Down
50 changes: 0 additions & 50 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -1,60 +1,10 @@
#if os(Linux)

import XCTest
@testable import CacheTests
@testable import SessionsTests
@testable import SettingsTests
@testable import CookiesTests
@testable import VaporTests
@testable import RoutingTests
@testable import HTTPRoutingTests

XCTMain([
// Cache
testCase(FluentCacheTests.allTests),
testCase(MemoryCacheTests.allTests),

// Config
testCase(ConfigTests.allTests),
testCase(MergeTests.allTests),
testCase(EnvTests.allTests),
testCase(CLIConfigTests.allTests),

// Cookies
testCase(CookiesTests.allTests),
testCase(CookieTests.allTests),
testCase(HTTPTests.allTests),
testCase(ParsingTests.allTests),
testCase(SerializingTests.allTests),

// Sessions
testCase(SessionsProtocolTests.allTests),
testCase(SessionTests.allTests),

// Vapor
testCase(ConfigIntegrationTests.allTests),
testCase(ConsoleTests.allTests),
testCase(ContentTests.allTests),
testCase(CookieTests.allTests),
testCase(DataSplitTests.allTests),
testCase(DropletTests.allTests),
testCase(EnvironmentTests.allTests),
testCase(EventTests.allTests),
testCase(FileManagerTests.allTests),
testCase(HashTests.allTests),
testCase(LocalizationTests.allTests),
testCase(LogTests.allTests),
testCase(MiddlewareTests.allTests),
testCase(ProcessTests.allTests),
testCase(ProviderTests.allTests),
testCase(ResourceTests.allTests),
testCase(RoutingTests.allTests),
testCase(SessionsTests.allTests),
testCase(ValidationConvenienceTests.allTests),
testCase(ValidationCountTests.allTests),
testCase(ValidationTests.allTests),
testCase(ValidationUniqueTests.allTests),

// Routing
testCase(BranchTests.allTests),
testCase(RouteBuilderTests.allTests),
Expand Down

0 comments on commit b5b8dbd

Please sign in to comment.