Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
Caroline
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Drew
Caroline
Commits
b7614a41
Commit
b7614a41
authored
May 22, 2016
by
Drew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swift 2.2 backport
parent
18a41527
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
CarolineCore/Functions.swift
CarolineCore/Functions.swift
+11
-0
No files found.
CarolineCore/Functions.swift
View file @
b7614a41
...
...
@@ -14,6 +14,7 @@
//MARK: Functions
extension
CarolineTest
{
#if swift(>=3.0)
public
final
func
assert
(
_
condition
:
@autoclosure
()
->
Bool
,
_
message
:
@autoclosure
()
->
String
=
"Test failed"
,
file
:
String
=
#file
,
line
:
Int
=
#line
)
{
if
!
condition
()
{
var
state
=
CarolineState
(
test
:
self
)
...
...
@@ -22,4 +23,14 @@ extension CarolineTest {
print
(
"Test failed at
\(
file
)
:
\(
line
)
-
\(
message
()
)
"
)
}
}
#else
public
final
func
assert
(
@autoclosure
_
condition
:
()
->
Bool
,
@autoclosure
_
message
:
()
->
String
=
"Test failed"
,
file
:
String
=
#file
,
line
:
Int
=
#line
)
{
if
!
condition
()
{
var
state
=
CarolineState
(
test
:
self
)
state
.
outcome
=
.
Failed
state
.
commit
()
print
(
"Test failed at
\(
file
)
:
\(
line
)
-
\(
message
()
)
"
)
}
}
#endif
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment