Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bbriatte committed Jan 6, 2019
2 parents 64f681e + 3557efa commit 565a596
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017, Digipolitan
Copyright (c) 2019, Digipolitan
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 8 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"object": {
"pins": [

]
},
"version": 1
}
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
StringCase
=================================

[![Swift Version](https://img.shields.io/badge/swift-4.2-orange.svg?style=flat)](https://developer.apple.com/swift/)
[![Swift Package Manager](https://rawgit.com/jlyonsmith/artwork/master/SwiftPackageManager/swiftpackagemanager-compatible.svg)](https://swift.org/package-manager/)
[![Twitter](https://img.shields.io/badge/twitter-@Digipolitan-blue.svg?style=flat)](http://twitter.com/Digipolitan)

Expand Down
4 changes: 2 additions & 2 deletions Sources/StringCase/StringCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public extension String {

public func camelCased(_ format: StringCaseFormat.CamelCase = .default) -> String {
var res: [String] = []
for (i, str) in self.caseSplit().enumerated() {
if i == 0 && format == .default {
for (idx, str) in self.caseSplit().enumerated() {
if idx == 0 && format == .default {
res.append(str.lowercased())
continue
}
Expand Down
9 changes: 5 additions & 4 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import XCTest
@testable import StringCaseTests

XCTMain([
testCase(StringCaseTests.allTests)
])
import StringCaseTests

var tests = [XCTestCaseEntry]()
tests += StringCaseTests.allTests()
XCTMain(tests)
2 changes: 1 addition & 1 deletion Tests/StringCaseTests/StringCamelCaseTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
@testable import StringCase

class StringCamelCaseTests: XCTestCase {
final class StringCamelCaseTests: XCTestCase {
func testCamelCase() {
XCTAssertEqual("i love swift".camelCased(), "iLoveSwift")
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/StringCaseTests/StringSnakeCaseTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
@testable import StringCase

class StringSnakeCaseTests: XCTestCase {
final class StringSnakeCaseTests: XCTestCase {
func testSnakeCase() {
XCTAssertEqual("i love swift".snakeCased(), "i_love_swift")
}
Expand Down
10 changes: 10 additions & 0 deletions Tests/StringCaseTests/XCTestManifests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import XCTest

#if !os(macOS)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(StringCamelCaseTests.allTests),
testCase(StringSnakeCaseTests.allTests)
]
}
#endif

0 comments on commit 565a596

Please sign in to comment.