File tree Expand file tree Collapse file tree 2 files changed +29
-24
lines changed
Sources/AtCoderLibrary/Command/New/Generator
Tests/AtCoderLibraryTests/Command/New/Generator Expand file tree Collapse file tree 2 files changed +29
-24
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,14 @@ struct Test: Generator {
1414 import XCTest
1515 import TestLibrary
1616
17+ let cases: [TestCase] = [
18+ \( problem. tests. map ( Self . testCase) . joined ( separator: " \n " ) )
19+ ]
20+
1721 final class \( className) : XCTestCase, TimeLimit {
1822 let timeLimit: TimeInterval = \( Double ( problem. timeLimit) / 1000 )
1923
2024 func testExample() throws {
21- let cases: [TestCase] = [
22- \( problem. tests. map ( Self . testCase) . joined ( separator: " \n " ) )
23- ]
2425 try cases.forEach(solve)
2526 }
2627 }
@@ -31,11 +32,12 @@ struct Test: Generator {
3132 let inputs = test. input. split ( separator: " \n " )
3233 let outputs = test. output. split ( separator: " \n " )
3334 return """
34- (#filePath, #line, \" " "
35- \( inputs. map { " \( $0) " } . joined ( separator: " \n " ) )
36- \" " " , \" " "
37- \( outputs. map { " \( $0) " } . joined ( separator: " \n " ) )
38- \" " " ),
35+ (#filePath, #line,
36+ \" " "
37+ \( inputs. map { " \( $0) " } . joined ( separator: " \n " ) )
38+ \" " " , \" " "
39+ \( outputs. map { " \( $0) " } . joined ( separator: " \n " ) )
40+ \" " " ),
3941 """
4042 }
4143}
Original file line number Diff line number Diff line change @@ -20,26 +20,29 @@ final class TestTests: XCTestCase {
2020 import XCTest
2121 import TestLibrary
2222
23+ let cases: [TestCase] = [
24+ (#filePath, #line,
25+ \" " "
26+ 10 2
27+ 20 3
28+ 30 4
29+ \" " " , \" " "
30+ 5
31+ 20
32+ 3
33+ \" " " ),
34+ (#filePath, #line,
35+ \" " "
36+ 199 2
37+ \" " " , \" " "
38+ 1992
39+ \" " " ),
40+ ]
41+
2342 final class ATests: XCTestCase, TimeLimit {
2443 let timeLimit: TimeInterval = 2.0
2544
2645 func testExample() throws {
27- let cases: [TestCase] = [
28- (#filePath, #line, \" " "
29- 10 2
30- 20 3
31- 30 4
32- \" " " , \" " "
33- 5
34- 20
35- 3
36- \" " " ),
37- (#filePath, #line, \" " "
38- 199 2
39- \" " " , \" " "
40- 1992
41- \" " " ),
42- ]
4346 try cases.forEach(solve)
4447 }
4548 }
You can’t perform that action at this time.
0 commit comments