Skip to content

Commit 965bd97

Browse files
committed
Resolve merge conflict and update scalafmt to 3.9.8
- Resolve merge conflict in MessagePackTest.scala by using Scala 3 compatible syntax - Update scalafmt version from 3.9.4 to 3.9.8 - Apply formatting with updated scalafmt version
2 parents 7bbea6b + 4bcc43e commit 965bd97

File tree

5 files changed

+48
-48
lines changed

5 files changed

+48
-48
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 3.9.4
1+
version = 3.9.8
22
project.layout = StandardConvention
33
runner.dialect = scala3
44
maxColumn = 100

msgpack-core/src/test/scala/org/msgpack/core/MessagePackTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ class MessagePackTest extends AirSpec with PropertyCheck with Benchmark:
376376
test("report errors when packing/unpacking malformed strings") {
377377
pending("We need to produce malformed utf-8 strings in Java 8")
378378
// Create 100 malformed UTF8 Strings
379-
val r = new Random(0)
379+
val r = new Random(0)
380380
val malformedStrings = Iterator
381381
.continually {
382382
val b = new Array[Byte](10)

msgpack-core/src/test/scala/org/msgpack/core/MessagePackerTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class MessagePackerTest extends AirSpec with Benchmark:
211211
}
212212

213213
test("compute totalWrittenBytes") {
214-
val out = new ByteArrayOutputStream
214+
val out = new ByteArrayOutputStream
215215
val packerTotalWrittenBytes =
216216
withResource(MessagePack.newDefaultPacker(out)) { packer =>
217217
packer

msgpack-core/src/test/scala/org/msgpack/core/MessageUnpackerTest.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import scala.util.Random
3030

3131
object MessageUnpackerTest:
3232
class SplitMessageBufferInput(array: Array[Array[Byte]]) extends MessageBufferInput:
33-
var cursor = 0
33+
var cursor = 0
3434
override def next(): MessageBuffer =
3535
if cursor < array.length then
3636
val a = array(cursor)
@@ -45,7 +45,7 @@ import org.msgpack.core.MessageUnpackerTest.*
4545

4646
class MessageUnpackerTest extends AirSpec with Benchmark:
4747

48-
private val universal = MessageBuffer.allocate(0).isInstanceOf[MessageBufferU]
48+
private val universal = MessageBuffer.allocate(0).isInstanceOf[MessageBufferU]
4949
private def testData: Array[Byte] =
5050
val out = new ByteArrayOutputStream()
5151
val packer = MessagePack.newDefaultPacker(out)
@@ -435,7 +435,7 @@ class MessageUnpackerTest extends AirSpec with Benchmark:
435435
val t =
436436
time("skip performance", repeat = N) {
437437
block("v6") {
438-
val v6 = new org.msgpack.MessagePack()
438+
val v6 = new org.msgpack.MessagePack()
439439
val unpacker =
440440
new org.msgpack.unpacker.MessagePackUnpacker(v6, new ByteArrayInputStream(data))
441441
var count = 0
@@ -567,7 +567,7 @@ class MessageUnpackerTest extends AirSpec with Benchmark:
567567
val t =
568568
time("unpack performance", repeat = N) {
569569
block("v6") {
570-
val v6 = new org.msgpack.MessagePack()
570+
val v6 = new org.msgpack.MessagePack()
571571
val unpacker =
572572
new org.msgpack.unpacker.MessagePackUnpacker(v6, new ByteArrayInputStream(data))
573573
var count = 0
@@ -655,7 +655,7 @@ class MessageUnpackerTest extends AirSpec with Benchmark:
655655

656656
time("unpackBinary", repeat = 100) {
657657
block("v6") {
658-
val v6 = new org.msgpack.MessagePack()
658+
val v6 = new org.msgpack.MessagePack()
659659
val unpacker =
660660
new org.msgpack.unpacker.MessagePackUnpacker(v6, new ByteArrayInputStream(b))
661661
var i = 0

msgpack-core/src/test/scala/org/msgpack/value/VariableTest.scala

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -181,39 +181,39 @@ class VariableTest extends AirSpec with PropertyCheck:
181181

182182
test("read integers") {
183183
forAll { (i: Int) =>
184-
check(
185-
_.packInt(i),
186-
checker =
187-
v =>
188-
val iv = validateValue(v.asIntegerValue(), asInteger = true)
189-
iv.asInt() shouldBe i
190-
iv.asLong() shouldBe i.toLong
191-
)
184+
check(
185+
_.packInt(i),
186+
checker =
187+
v =>
188+
val iv = validateValue(v.asIntegerValue(), asInteger = true)
189+
iv.asInt() shouldBe i
190+
iv.asLong() shouldBe i.toLong
191+
)
192192
}
193193
}
194194

195195
test("read double") {
196196
forAll { (x: Double) =>
197-
check(
198-
_.packDouble(x),
199-
checker =
200-
v =>
201-
val iv = validateValue(v.asFloatValue(), asFloat = true)
202-
// iv.toDouble shouldBe v
203-
// iv.toFloat shouldBe x.toFloat
204-
)
197+
check(
198+
_.packDouble(x),
199+
checker =
200+
v =>
201+
val iv = validateValue(v.asFloatValue(), asFloat = true)
202+
// iv.toDouble shouldBe v
203+
// iv.toFloat shouldBe x.toFloat
204+
)
205205
}
206206
}
207207

208208
test("read boolean") {
209209
forAll { (x: Boolean) =>
210-
check(
211-
_.packBoolean(x),
212-
checker =
213-
v =>
214-
val iv = validateValue(v.asBooleanValue(), asBoolean = true)
215-
iv.getBoolean shouldBe x
216-
)
210+
check(
211+
_.packBoolean(x),
212+
checker =
213+
v =>
214+
val iv = validateValue(v.asBooleanValue(), asBoolean = true)
215+
iv.getBoolean shouldBe x
216+
)
217217
}
218218
}
219219

@@ -234,13 +234,13 @@ class VariableTest extends AirSpec with PropertyCheck:
234234

235235
test("read string") {
236236
forAll { (x: String) =>
237-
check(
238-
_.packString(x),
239-
checker =
240-
v =>
241-
val iv = validateValue(v.asStringValue(), asString = true)
242-
iv.asString() shouldBe x
243-
)
237+
check(
238+
_.packString(x),
239+
checker =
240+
v =>
241+
val iv = validateValue(v.asStringValue(), asString = true)
242+
iv.asString() shouldBe x
243+
)
244244
}
245245
}
246246

@@ -280,7 +280,7 @@ class VariableTest extends AirSpec with PropertyCheck:
280280
},
281281
checker =
282282
v =>
283-
val iv = validateValue(v.asMapValue(), asMap = true)
283+
val iv = validateValue(v.asMapValue(), asMap = true)
284284
val lst =
285285
iv.map()
286286
.asScala
@@ -293,15 +293,15 @@ class VariableTest extends AirSpec with PropertyCheck:
293293

294294
test("read timestamps") {
295295
forAll { (millis: Long) =>
296-
val i = Instant.ofEpochMilli(millis)
297-
check(
298-
_.packTimestamp(i),
299-
checker =
300-
v =>
301-
val ts = validateValue(v.asTimestampValue(), asTimestamp = true)
302-
ts.isTimestampValue shouldBe true
303-
ts.toInstant shouldBe i
304-
)
296+
val i = Instant.ofEpochMilli(millis)
297+
check(
298+
_.packTimestamp(i),
299+
checker =
300+
v =>
301+
val ts = validateValue(v.asTimestampValue(), asTimestamp = true)
302+
ts.isTimestampValue shouldBe true
303+
ts.toInstant shouldBe i
304+
)
305305
}
306306
}
307307
}

0 commit comments

Comments
 (0)