Skip to content

Commit

Permalink
Fix some remaining compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Feb 6, 2025
1 parent 86dbb45 commit 3817519
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 92 deletions.
8 changes: 4 additions & 4 deletions src/core/hypotenuse.Commensurable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import denominative.*
import rudiments.*

object Commensurable:
inline given numeric: [OperandType <: Int | Double | Char | Byte | Short | Float]
inline given numeric: [OperandType <: Long | Int | Double | Char | Byte | Short | Float]
=> Boolean is Commensurable:
type Operand = OperandType

inline def compare
(inline left: Boolean,
inline right: OperandType,
inline strict: Boolean,
(inline left: Boolean,
inline right: OperandType,
inline strict: Boolean,
inline greaterThan: Boolean)
: Boolean =

Expand Down
176 changes: 88 additions & 88 deletions src/test/hypotenuse.Tests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object Tests extends Suite(t"Hypotenuse tests"):
val left: U64 = 123

suite(t"Bitmap tests"):
test(t"Check first bit of 6"):
test(t"Check first bit of 10"):
B64(Bytes(10))(Prim)
.assert(_ == false)

Expand All @@ -49,125 +49,125 @@ object Tests extends Suite(t"Hypotenuse tests"):
test(t"Check first four bits of 6")(B64(Bytes(6))(Prim ~ Quat)).assert(_ == B64(6))
test(t"Check middle two bits of 6")(B64(Bytes(6))(Sec ~ Ter)).assert(_ == B64(3))

test(t"Check middle two bits as subsequent")(B64(Bytes(6))(Prim.subsequent(2))
test(t"Check middle two bits as subsequent")(B64(Bytes(6))(Prim.subsequent(2)))
. assert(_ == B64(3))

test(t"Check first two bits as preceding")(B64(Bytes(6))(Ter.preceding(2)))
. assert(_ == B64(2))


// suite(t"Inequality tests"):
// test(t"1.2 < x < 1.4"):
// List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 < _ < 1.4)
// .assert(_ == List(1.3))
suite(t"Inequality tests"):
test(t"1.2 < x < 1.4"):
List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 < _ < 1.4)
.assert(_ == List(1.3))

// test(t"1.2 < x <= 1.4"):
// List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 < _ <= 1.4)
// .assert(_ == List(1.3, 1.4))
test(t"1.2 < x <= 1.4"):
List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 < _ <= 1.4)
.assert(_ == List(1.3, 1.4))

// test(t"1.2 <= x < 1.4"):
// List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 <= _ < 1.4)
// .assert(_ == List(1.2, 1.3))
test(t"1.2 <= x < 1.4"):
List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 <= _ < 1.4)
.assert(_ == List(1.2, 1.3))

// test(t"1.2 <= x <= 1.4"):
// List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 <= _ <= 1.4)
// .assert(_ == List(1.2, 1.3, 1.4))
test(t"1.2 <= x <= 1.4"):
List(1.1, 1.2, 1.3, 1.4, 1.5).filter(1.2 <= _ <= 1.4)
.assert(_ == List(1.2, 1.3, 1.4))

// test(t"2 < x < 4"):
// List(1, 2, 3, 4, 5).filter(2 < _ < 4)
// .assert(_ == List(3))
test(t"2 < x < 4"):
List(1, 2, 3, 4, 5).filter(2 < _ < 4)
.assert(_ == List(3))

// test(t"2 < x <= 4"):
// List(1, 2, 3, 4, 5).filter(2 < _ <= 4)
// .assert(_ == List(3, 4))
test(t"2 < x <= 4"):
List(1, 2, 3, 4, 5).filter(2 < _ <= 4)
.assert(_ == List(3, 4))

// test(t"2 <= x < 4"):
// List(1, 2, 3, 4, 5).filter(2 <= _ < 4)
// .assert(_ == List(2, 3))
test(t"2 <= x < 4"):
List(1, 2, 3, 4, 5).filter(2 <= _ < 4)
.assert(_ == List(2, 3))

// test(t"2 <= x <= 4"):
// List(1, 2, 3, 4, 5).filter(2 <= _ <= 4)
// .assert(_ == List(2, 3, 4))
test(t"2 <= x <= 4"):
List(1, 2, 3, 4, 5).filter(2 <= _ <= 4)
.assert(_ == List(2, 3, 4))

// test(t"2L < x < 4L"):
// List(1L, 2L, 3L, 4L, 5L).filter(2L < _ < 4L)
// .assert(_ == List(3L))
test(t"2L < x < 4L"):
List(1L, 2L, 3L, 4L, 5L).filter(2L < _ < 4L)
.assert(_ == List(3L))

// test(t"2L < x <= 4L"):
// List(1L, 2L, 3L, 4L, 5L).filter(2L < _ <= 4L)
// .assert(_ == List(3L, 4L))
test(t"2L < x <= 4L"):
List(1L, 2L, 3L, 4L, 5L).filter(2L < _ <= 4L)
.assert(_ == List(3L, 4L))

// test(t"2L <= x < 4L"):
// List(1L, 2L, 3L, 4L, 5L).filter(2L <= _ < 4L)
// .assert(_ == List(2L, 3L))
test(t"2L <= x < 4L"):
List(1L, 2L, 3L, 4L, 5L).filter(2L <= _ < 4L)
.assert(_ == List(2L, 3L))

// test(t"2L <= x <= 4L"):
// List(1L, 2L, 3L, 4L, 5L).filter(2L <= _ <= 4L)
// .assert(_ == List(2L, 3L, 4L))
test(t"2L <= x <= 4L"):
List(1L, 2L, 3L, 4L, 5L).filter(2L <= _ <= 4L)
.assert(_ == List(2L, 3L, 4L))

// test(t"2F < x < 4F"):
// List(1F, 2F, 3F, 4F, 5F).filter(2F < _ < 4F)
// .assert(_ == List(3F))
test(t"2F < x < 4F"):
List(1F, 2F, 3F, 4F, 5F).filter(2F < _ < 4F)
.assert(_ == List(3F))

// test(t"2F < x <= 4F"):
// List(1F, 2F, 3F, 4F, 5F).filter(2F < _ <= 4F)
// .assert(_ == List(3F, 4F))
test(t"2F < x <= 4F"):
List(1F, 2F, 3F, 4F, 5F).filter(2F < _ <= 4F)
.assert(_ == List(3F, 4F))

// test(t"2F <= x < 4F"):
// List(1F, 2F, 3F, 4F, 5F).filter(2F <= _ < 4F)
// .assert(_ == List(2F, 3F))
test(t"2F <= x < 4F"):
List(1F, 2F, 3F, 4F, 5F).filter(2F <= _ < 4F)
.assert(_ == List(2F, 3F))

// test(t"2F <= x <= 4F"):
// List(1F, 2F, 3F, 4F, 5F).filter(2F <= _ <= 4F)
// .assert(_ == List(2F, 3F, 4F))
test(t"2F <= x <= 4F"):
List(1F, 2F, 3F, 4F, 5F).filter(2F <= _ <= 4F)
.assert(_ == List(2F, 3F, 4F))

// test(t"'2' < x < '4'"):
// List('1', '2', '3', '4', '5').filter('2' < _ < '4')
// .assert(_ == List('3'))
test(t"'2' < x < '4'"):
List('1', '2', '3', '4', '5').filter('2' < _ < '4')
.assert(_ == List('3'))

// test(t"'2' < x <= '4'"):
// List('1', '2', '3', '4', '5').filter('2' < _ <= '4')
// .assert(_ == List('3', '4'))
test(t"'2' < x <= '4'"):
List('1', '2', '3', '4', '5').filter('2' < _ <= '4')
.assert(_ == List('3', '4'))

// test(t"'2' <= x < '4'"):
// List('1', '2', '3', '4', '5').filter('2' <= _ < '4')
// .assert(_ == List('2', '3'))
test(t"'2' <= x < '4'"):
List('1', '2', '3', '4', '5').filter('2' <= _ < '4')
.assert(_ == List('2', '3'))

// test(t"'2' <= x <= '4'"):
// List('1', '2', '3', '4', '5').filter('2' <= _ <= '4')
// .assert(_ == List('2', '3', '4'))

// test(t"2.toByte < x < 4.toByte"):
// List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte < _ < 4.toByte)
// .assert(_ == List(3.toByte))
test(t"'2' <= x <= '4'"):
List('1', '2', '3', '4', '5').filter('2' <= _ <= '4')
.assert(_ == List('2', '3', '4'))

// test(t"2.toByte < x <= 4.toByte"):
// List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte < _ <= 4.toByte)
// .assert(_ == List(3.toByte, 4.toByte))
test(t"2.toByte < x < 4.toByte"):
List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte < _ < 4.toByte)
.assert(_ == List(3.toByte))

// test(t"2.toByte <= x < 4.toByte"):
// List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte <= _ < 4.toByte)
// .assert(_ == List(2.toByte, 3.toByte))
test(t"2.toByte < x <= 4.toByte"):
List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte < _ <= 4.toByte)
.assert(_ == List(3.toByte, 4.toByte))

// test(t"2.toByte <= x <= 4.toByte"):
// List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte <= _ <= 4.toByte)
// .assert(_ == List(2.toByte, 3.toByte, 4.toByte))
test(t"2.toByte <= x < 4.toByte"):
List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte <= _ < 4.toByte)
.assert(_ == List(2.toByte, 3.toByte))

// test(t"2.toShort < x < 4.toShort"):
// List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort < _ < 4.toShort)
// .assert(_ == List(3.toShort))
test(t"2.toByte <= x <= 4.toByte"):
List(1.toByte, 2.toByte, 3.toByte, 4.toByte, 5.toByte).filter(2.toByte <= _ <= 4.toByte)
.assert(_ == List(2.toByte, 3.toByte, 4.toByte))

// test(t"2.toShort < x <= 4.toShort"):
// List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort < _ <= 4.toShort)
// .assert(_ == List(3.toShort, 4.toShort))
test(t"2.toShort < x < 4.toShort"):
List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort < _ < 4.toShort)
.assert(_ == List(3.toShort))

test(t"2.toShort < x <= 4.toShort"):
List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort < _ <= 4.toShort)
.assert(_ == List(3.toShort, 4.toShort))

// test(t"2.toShort <= x < 4.toShort"):
// List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort <= _ < 4.toShort)
// .assert(_ == List(2.toShort, 3.toShort))
test(t"2.toShort <= x < 4.toShort"):
List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort <= _ < 4.toShort)
.assert(_ == List(2.toShort, 3.toShort))

// test(t"2.toShort <= x <= 4.toShort"):
// List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort <= _ <= 4.toShort)
// .assert(_ == List(2.toShort, 3.toShort, 4.toShort))
test(t"2.toShort <= x <= 4.toShort"):
List(1.toShort, 2.toShort, 3.toShort, 4.toShort, 5.toShort).filter(2.toShort <= _ <= 4.toShort)
.assert(_ == List(2.toShort, 3.toShort, 4.toShort))



Expand Down

0 comments on commit 3817519

Please sign in to comment.