Skip to content

Commit 3083112

Browse files
committed
Update indentation style
1 parent 9e7d277 commit 3083112

File tree

4 files changed

+77
-70
lines changed

4 files changed

+77
-70
lines changed

src/core/macros.scala

+35-35
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ import scala.quoted.*
2828

2929
object Probably:
3030
protected def general[TestType: Type, ReportType: Type, ResultType: Type]
31-
(test: Expr[Test[TestType]],
32-
predicate: Expr[TestType => Boolean],
33-
runner: Expr[Runner[ReportType]],
34-
inc: Expr[Inclusion[ReportType, Outcome]],
35-
inc2: Expr[Inclusion[ReportType, DebugInfo]],
36-
action: Expr[TestRun[TestType] => ResultType])
37-
(using Quotes)
31+
(test: Expr[Test[TestType]],
32+
predicate: Expr[TestType => Boolean],
33+
runner: Expr[Runner[ReportType]],
34+
inc: Expr[Inclusion[ReportType, Outcome]],
35+
inc2: Expr[Inclusion[ReportType, DebugInfo]],
36+
action: Expr[TestRun[TestType] => ResultType])
37+
(using Quotes)
3838
: Expr[ResultType] =
3939

4040
import quotes.reflect.*
@@ -61,59 +61,59 @@ object Probably:
6161

6262
'{
6363
assertion[testType, TestType, ReportType, ResultType]
64-
($runner, $test, $predicate, $action, $contrast, Some($expr), $inc, $inc2, $inspectable)
64+
($runner, $test, $predicate, $action, $contrast, Some($expr), $inc, $inc2, $inspectable)
6565
}
6666

6767
case _ =>
6868
'{
6969
assertion[TestType, TestType, ReportType, ResultType]
70-
($runner, $test, $predicate, $action, Contrastable.nothing[TestType], None, $inc, $inc2,
70+
($runner, $test, $predicate, $action, Contrastable.nothing[TestType], None, $inc, $inc2,
7171
_.toString.tt)
7272
}
7373

7474
def check[TestType: Type, ReportType: Type]
75-
(test: Expr[Test[TestType]],
76-
predicate: Expr[TestType => Boolean],
77-
runner: Expr[Runner[ReportType]],
78-
inc: Expr[Inclusion[ReportType, Outcome]],
79-
inc2: Expr[Inclusion[ReportType, DebugInfo]])
80-
(using Quotes)
75+
(test: Expr[Test[TestType]],
76+
predicate: Expr[TestType => Boolean],
77+
runner: Expr[Runner[ReportType]],
78+
inc: Expr[Inclusion[ReportType, Outcome]],
79+
inc2: Expr[Inclusion[ReportType, DebugInfo]])
80+
(using Quotes)
8181
: Expr[TestType] =
8282

8383
general[TestType, ReportType, TestType](test, predicate, runner, inc, inc2, '{ (t: TestRun[TestType]) => t.get })
8484

8585
def assert[TestType: Type, ReportType: Type]
86-
(test: Expr[Test[TestType]],
87-
predicate: Expr[TestType => Boolean],
88-
runner: Expr[Runner[ReportType]],
89-
inc: Expr[Inclusion[ReportType, Outcome]],
90-
inc2: Expr[Inclusion[ReportType, DebugInfo]])
91-
(using Quotes)
86+
(test: Expr[Test[TestType]],
87+
predicate: Expr[TestType => Boolean],
88+
runner: Expr[Runner[ReportType]],
89+
inc: Expr[Inclusion[ReportType, Outcome]],
90+
inc2: Expr[Inclusion[ReportType, DebugInfo]])
91+
(using Quotes)
9292
: Expr[Unit] =
9393
general[TestType, ReportType, Unit](test, predicate, runner, inc, inc2, '{ (t: TestRun[TestType]) => () })
9494

9595
def aspire[TestType: Type, ReportType: Type]
96-
(test: Expr[Test[TestType]],
97-
runner: Expr[Runner[ReportType]],
98-
inc: Expr[Inclusion[ReportType, Outcome]],
99-
inc2: Expr[Inclusion[ReportType, DebugInfo]])
100-
(using Quotes)
96+
(test: Expr[Test[TestType]],
97+
runner: Expr[Runner[ReportType]],
98+
inc: Expr[Inclusion[ReportType, Outcome]],
99+
inc2: Expr[Inclusion[ReportType, DebugInfo]])
100+
(using Quotes)
101101
: Expr[Unit] =
102102

103103
general[TestType, ReportType, Unit](test, '{ _ => true }, runner, inc, inc2, '{ (t: TestRun[TestType]) => () })
104104

105105
def succeed: Any => Boolean = (value: Any) => true
106106

107107
def assertion[TestType, TestType2 <: TestType, ReportType, ResultType]
108-
(runner: Runner[ReportType],
109-
test: Test[TestType2],
110-
predicate: TestType2 => Boolean,
111-
result: TestRun[TestType2] => ResultType,
112-
contrast: TestType is Contrastable,
113-
exp: Option[TestType],
114-
inc: Inclusion[ReportType, Outcome],
115-
inc2: Inclusion[ReportType, DebugInfo],
116-
display: TestType is Inspectable)
108+
(runner: Runner[ReportType],
109+
test: Test[TestType2],
110+
predicate: TestType2 => Boolean,
111+
result: TestRun[TestType2] => ResultType,
112+
contrast: TestType is Contrastable,
113+
exp: Option[TestType],
114+
inc: Inclusion[ReportType, Outcome],
115+
inc2: Inclusion[ReportType, DebugInfo],
116+
display: TestType is Inspectable)
117117
: ResultType =
118118

119119
runner.run(test).pipe: run =>

src/core/probably.scala

+21-20
Original file line numberDiff line numberDiff line change
@@ -140,53 +140,54 @@ def test[ReportType](name: Text)(using suite: TestSuite, codepoint: Codepoint):
140140
TestId(name, suite, codepoint)
141141

142142
def suite[ReportType](name: Text)(using suite: TestSuite, runner: Runner[ReportType])
143-
(block: TestSuite ?=> Unit)
143+
(block: TestSuite ?=> Unit)
144144
: Unit =
145145

146146
runner.suite(TestSuite(name, suite), block)
147147

148148
extension [TestType](test: Test[TestType])
149149
inline def aspire[ReportType](inline predicate: TestType => Boolean)
150-
(using runner: Runner[ReportType], inc: Inclusion[ReportType, Outcome],
151-
inc2: Inclusion[ReportType, DebugInfo])
150+
(using runner: Runner[ReportType],
151+
inc: Inclusion[ReportType, Outcome],
152+
inc2: Inclusion[ReportType, DebugInfo])
152153
: Unit =
153154
${Probably.aspire[TestType, ReportType]('test, 'runner, 'inc, 'inc2)}
154155

155156
inline def assert[ReportType]
156-
(inline predicate: TestType => Boolean)
157-
(using runner: Runner[ReportType],
158-
inclusion: Inclusion[ReportType, Outcome],
159-
inclusion2: Inclusion[ReportType, DebugInfo])
157+
(inline predicate: TestType => Boolean)
158+
(using runner: Runner[ReportType],
159+
inclusion: Inclusion[ReportType, Outcome],
160+
inclusion2: Inclusion[ReportType, DebugInfo])
160161
: Unit =
161162
${Probably.assert[TestType, ReportType]('test, 'predicate, 'runner, 'inclusion, 'inclusion2)}
162163

163164
inline def check[ReportType]
164-
(inline predicate: TestType => Boolean)
165-
(using runner: Runner[ReportType],
166-
inclusion: Inclusion[ReportType, Outcome],
167-
inclusion2: Inclusion[ReportType, DebugInfo])
165+
(inline predicate: TestType => Boolean)
166+
(using runner: Runner[ReportType],
167+
inclusion: Inclusion[ReportType, Outcome],
168+
inclusion2: Inclusion[ReportType, DebugInfo])
168169
: TestType =
169170
${Probably.check[TestType, ReportType]('test, 'predicate, 'runner, 'inclusion, 'inclusion2)}
170171

171172
inline def assert[ReportType]()
172-
(using runner: Runner[ReportType],
173-
inclusion: Inclusion[ReportType, Outcome],
174-
inclusion2: Inclusion[ReportType, DebugInfo])
173+
(using runner: Runner[ReportType],
174+
inclusion: Inclusion[ReportType, Outcome],
175+
inclusion2: Inclusion[ReportType, DebugInfo])
175176
: Unit =
176177
${Probably.assert[TestType, ReportType]('test, '{Probably.succeed}, 'runner, 'inclusion, 'inclusion2)}
177178

178179
inline def check[ReportType]()
179-
(using runner: Runner[ReportType],
180-
inclusion: Inclusion[ReportType, Outcome],
181-
inclusion2: Inclusion[ReportType, DebugInfo])
180+
(using runner: Runner[ReportType],
181+
inclusion: Inclusion[ReportType, Outcome],
182+
inclusion2: Inclusion[ReportType, DebugInfo])
182183
: TestType =
183184

184185
${Probably.check[TestType, ReportType]('test, '{Probably.succeed}, 'runner, 'inclusion, 'inclusion2)}
185186

186187
inline def matches[ReportType](inline pf: PartialFunction[TestType, Any])
187-
(using runner: Runner[ReportType],
188-
inc: Inclusion[ReportType, Outcome],
189-
inc2: Inclusion[ReportType, DebugInfo])
188+
(using runner: Runner[ReportType],
189+
inc: Inclusion[ReportType, Outcome],
190+
inc2: Inclusion[ReportType, DebugInfo])
190191
: Unit =
191192

192193
assert[ReportType](pf.isDefinedAt(_))

src/core/report.scala

+9-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export Baseline.Metric.{BySpeed, ByTime}
5252
export Baseline.Calc.{Ratio, Difference}
5353

5454
case class Baseline
55-
(compare: Baseline.Compare = Mean, metric: Baseline.Metric = BySpeed, calc: Baseline.Calc = Ratio)
55+
(compare: Baseline.Compare = Mean, metric: Baseline.Metric = BySpeed, calc: Baseline.Calc = Ratio)
5656

5757
object Benchmark:
5858
given Inclusion[TestReport, Benchmark] with
@@ -61,8 +61,14 @@ object Benchmark:
6161
type Percentiles = 80 | 85 | 90 | 95 | 96 | 97 | 98 | 99
6262

6363
case class Benchmark
64-
(total: Long, count: Int, min: Double, mean: Double, max: Double, sd: Double,
65-
confidence: Benchmark.Percentiles, baseline: Optional[Baseline]):
64+
(total: Long,
65+
count: Int,
66+
min: Double,
67+
mean: Double,
68+
max: Double,
69+
sd: Double,
70+
confidence: Benchmark.Percentiles,
71+
baseline: Optional[Baseline]):
6672

6773
def zScore(percentile: Benchmark.Percentiles): Double = percentile match
6874
case 80 => 0.842

src/coverage/coverage.scala

+12-12
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ object Juncture:
3131
given Ordering[Juncture] = Ordering.by[Juncture, Int](_.start).orElseBy(-_.end)
3232

3333
case class Juncture
34-
(id: Int,
35-
path: Text,
36-
className: Text,
37-
methodName: Text,
38-
start: Int,
39-
end: Int,
40-
lineNo: Int,
41-
symbolName: Text,
42-
treeName: Text,
43-
branch: Boolean,
44-
ignored: Boolean,
45-
code: List[Text]):
34+
(id: Int,
35+
path: Text,
36+
className: Text,
37+
methodName: Text,
38+
start: Int,
39+
end: Int,
40+
lineNo: Int,
41+
symbolName: Text,
42+
treeName: Text,
43+
branch: Boolean,
44+
ignored: Boolean,
45+
code: List[Text]):
4646

4747
def contains(right: Juncture): Boolean =
4848
(right.start >= start && right.end <= end && !(right.start == start && right.end == end)) ||

0 commit comments

Comments
 (0)