-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from idomizrachi/template-engine-support
Template engine support
- Loading branch information
Showing
71 changed files
with
5,553 additions
and
767 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
os: osx | ||
osx_image: xcode10.2 | ||
language: swift | ||
script: | ||
- xcodebuild -scheme regen clean build test | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) -J 'regen' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
coverage: | ||
ignore: | ||
- "regen/Dependencies/**/*" | ||
- "regen-tests/**/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// | ||
// ArgumentsParserTests.swift | ||
// regen-tests | ||
// | ||
// Created by Ido Mizrachi on 12/07/2019. | ||
// Copyright © 2019 Ido Mizrachi. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
|
||
class ArgumentsParserTests: XCTestCase { | ||
|
||
func testEmptyArguments() { | ||
let argumentsParser = ArgumentsParser(arguments: []) | ||
switch argumentsParser.operationType { | ||
case .usage: break | ||
default: XCTFail("Bad operation") | ||
} | ||
} | ||
} | ||
|
||
class ArgumentsParserLocalizationTests: XCTestCase { | ||
|
||
func testLocalizationOperationDefaultArguments() { | ||
let argumentsParser = ArgumentsParser(arguments: ["localization"]) | ||
switch argumentsParser.operationType { | ||
case .usage: break | ||
default: XCTFail("Bad operation") | ||
} | ||
|
||
} | ||
|
||
func testLocalizationOperationWithMissingSearchPath() { | ||
let argumentsParser = ArgumentsParser(arguments: ["localization", "--template", "hello", "--output", "Gen.m"]) | ||
switch argumentsParser.operationType { | ||
case .usage: break | ||
default: XCTFail("Bad operation") | ||
} | ||
} | ||
|
||
// func testLocalizationOperationWithMissingOutput() { | ||
// let argumentsParser = ArgumentsParser(arguments: ["localization", "--search-path", "hello", "--template", "hello"]) | ||
// switch argumentsParser.operationType { | ||
// case .usage: break | ||
// default: XCTFail("Bad operation") | ||
// } | ||
// } | ||
|
||
func testLocalizationOperationWithMissingTemplate() { | ||
let argumentsParser = ArgumentsParser(arguments: ["localization", "--output", "hello", "--search-path", "hello"]) | ||
switch argumentsParser.operationType { | ||
case .usage: break | ||
default: XCTFail("Bad operation") | ||
} | ||
} | ||
|
||
func testImagesOperationWithDefaultArguments() { | ||
let argumentsParser = ArgumentsParser(arguments: ["images"]) | ||
switch argumentsParser.operationType { | ||
case .usage: break | ||
default: XCTFail("Bad operation") | ||
} | ||
} | ||
|
||
|
||
// func testLocalizationOperationWithValidParameters() { | ||
// let argumentsParser = ArgumentsParser(arguments: ["localization", "--template", "hello", "--output", "Gen.swift", "--search-path", "Search Path", "--base-language-code", "he"]) | ||
// switch argumentsParser.operationType { | ||
// case .localization(let parameters): | ||
// XCTAssertEqual(parameters.templateFilepath, "hello") | ||
// XCTAssertEqual(parameters.outputFilename, "Gen.swift") | ||
// XCTAssertEqual(parameters.searchPath, "Search Path") | ||
// XCTAssertEqual(parameters.baseLanguageCode, "he") | ||
// default: XCTFail("Bad operation") | ||
// } | ||
// } | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>BNDL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// StringClassNameTests.swift | ||
// regen-tests | ||
// | ||
// Created by Ido Mizrachi on 24/07/2019. | ||
// Copyright © 2019 Ido Mizrachi. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
|
||
class StringClassNameTests: XCTestCase { | ||
|
||
func testConvertToClassName() { | ||
let text = "helloThere" | ||
XCTAssertEqual(text.className(), "HelloThere") | ||
} | ||
|
||
func testEmptyString() { | ||
let text = "" | ||
XCTAssertEqual(text.className(), "") | ||
} | ||
|
||
func testAlreadyCapitalizedString() { | ||
let text = "HOLYSheep" | ||
XCTAssertEqual(text.className(), "HOLYSheep") | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// regen_tests.swift | ||
// regen-tests | ||
// | ||
// Created by Ido Mizrachi on 12/07/2019. | ||
// Copyright © 2019 Ido Mizrachi. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
|
||
|
||
class regen_tests: XCTestCase { | ||
|
||
|
||
} |
Oops, something went wrong.