forked from adobe/aepsdk-rulesengine-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
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 adobe#26 from adobe/dev
Dev to main
- Loading branch information
Showing
17 changed files
with
321 additions
and
114 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 @@ | ||
5.0 |
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 |
---|---|---|
@@ -1,3 +1,21 @@ | ||
included: # paths to include during linting. `--path` is ignored if present. | ||
- Sources | ||
- Tests | ||
|
||
line_length: 1000 | ||
function_body_length: 500 | ||
disabled_rules: # rule identifiers to exclude from running | ||
- identifier_name | ||
- force_cast | ||
- todo | ||
- multiple_closures_with_trailing_closure | ||
- cyclomatic_complexity | ||
- file_length | ||
- unused_optional_binding | ||
- implicit_getter | ||
- shorthand_operator | ||
- nesting | ||
- switch_case_alignment | ||
- orphaned_doc_comment | ||
- type_name | ||
- large_tuple | ||
- trailing_comma |
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 @@ | ||
lint-autocorrect: | ||
swiftlint autocorrect | ||
|
||
lint: | ||
swiftlint lint | ||
|
||
check-format: | ||
swiftformat --lint Sources | ||
|
||
format: | ||
swiftformat . | ||
|
||
generate-lcov: | ||
xcrun llvm-cov export -format="lcov" .build/debug/AEPRulesEnginePackageTests.xctest/Contents/MacOS/AEPRulesEnginePackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov | ||
|
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
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
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,39 @@ | ||
/* | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
|
||
import Foundation | ||
import XCTest | ||
|
||
@testable import AEPRulesEngine | ||
|
||
class OperandTests: XCTestCase { | ||
|
||
func testMustacheNoneValue() { | ||
let mustache = Operand<String>(mustache: "") | ||
XCTAssertEqual("<None>", String(describing: mustache)) | ||
} | ||
|
||
func testDoubleValue(){ | ||
let operand = Operand(floatLiteral: 1.2) | ||
XCTAssertEqual("<Value:1.2>", String(describing: operand)) | ||
} | ||
|
||
func testBoolValue(){ | ||
let operand = Operand(booleanLiteral: true) | ||
XCTAssertEqual("<Value:true>", String(describing: operand)) | ||
} | ||
|
||
func testNilValue(){ | ||
let operand: Operand<String> = nil | ||
XCTAssertEqual("<None>", String(describing: operand)) | ||
} | ||
} |
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
56 changes: 0 additions & 56 deletions
56
Tests/AEPRulesEngineTests/UnitTests/RulesEngineDebugTests.swift
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
Tests/AEPRulesEngineTests/UnitTests/RulesEngineLogLevelTests.swift
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,30 @@ | ||
/* | ||
Copyright 2020 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
|
||
@testable import AEPRulesEngine | ||
import XCTest | ||
|
||
class RulesEngineLogLevelTests: XCTestCase { | ||
|
||
func testLogLevelComparison() { | ||
XCTAssertTrue(RulesEngineLogLevel.error < RulesEngineLogLevel.warning) | ||
XCTAssertTrue(RulesEngineLogLevel.warning < RulesEngineLogLevel.debug) | ||
XCTAssertTrue(RulesEngineLogLevel.debug < RulesEngineLogLevel.trace) | ||
} | ||
|
||
func testLogLevelToString() { | ||
XCTAssertEqual(RulesEngineLogLevel.error.toString(), "ERROR") | ||
XCTAssertEqual(RulesEngineLogLevel.warning.toString(), "WARNING") | ||
XCTAssertEqual(RulesEngineLogLevel.debug.toString(), "DEBUG") | ||
XCTAssertEqual(RulesEngineLogLevel.trace.toString(), "TRACE") | ||
} | ||
} |
Oops, something went wrong.