-
-
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.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
included: | ||
- Sources | ||
- Tests |
13 changes: 13 additions & 0 deletions
13
Sources/Problems/007 - Reverse Integer/ReverseIntegerDefinition.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,13 @@ | ||
// | ||
// ReverseIntegerDefinition.swift | ||
// LeetSwift | ||
// | ||
// Created by Jobert Sá on 15/07/2024. | ||
// | ||
|
||
import Foundation | ||
import Core | ||
|
||
public protocol ReverseIntegerDefinition { | ||
func reverse(_ x: Int) -> Int | ||
} |
34 changes: 34 additions & 0 deletions
34
Tests/SolutionsTests/007 - Reverse Integer/ReverseIntegerTestCaseProvider.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,34 @@ | ||
// | ||
// ReverseIntegerTestCaseProvider.swift | ||
// LeetSwift | ||
// | ||
// Created by Jobert Sá on 15/07/2024. | ||
// | ||
|
||
@testable import Core | ||
@testable import TestSupport | ||
|
||
protocol ReverseIntegerTestCaseProvider: TestCaseProviding { } | ||
|
||
extension ReverseIntegerTestCaseProvider { | ||
|
||
func validateInput(_ input: Int) -> Bool { | ||
// TODO: Implement validation | ||
true | ||
} | ||
|
||
var data: [TestData<Int, Int>] { [ | ||
TestData( | ||
input: 123, | ||
expectedOutput: 321 | ||
), | ||
TestData( | ||
input: -123, | ||
expectedOutput: -321 | ||
), | ||
TestData( | ||
input: 120, | ||
expectedOutput: 21 | ||
) | ||
] } | ||
} |