• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Martomate / TriPaint / 9275511596

28 May 2024 07:51PM UTC coverage: 29.682% (+1.8%) from 27.877%
9275511596

push

github

Martomate
Updated to Scala 3.4 and MUnit 1.0

2 of 11 new or added lines in 9 files covered. (18.18%)

430 existing lines in 38 files now uncovered.

401 of 1351 relevant lines covered (29.68%)

0.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

56.25
/src/main/scala/tripaint/model/UndoManager.scala
1
package tripaint.model
2

3
import scala.collection.mutable.ArrayBuffer
4

5
class UndoManager {
6
  private val changes = ArrayBuffer.empty[Change]
1✔
7
  private var redoIndex = 0
8

9
  private def canUndo: Boolean = redoIndex > 0
1✔
10

11
  def undo(): Boolean =
1✔
12
    if canUndo then
1✔
13
      redoIndex -= 1
1✔
14
      changes(redoIndex).undo()
1✔
15
      true
UNCOV
16
    else false
×
17

18
  private def canRedo: Boolean = redoIndex <= changes.size - 1
1✔
19

20
  def redo(): Boolean =
×
21
    if canRedo then
×
22
      redoIndex += 1
×
UNCOV
23
      changes(redoIndex - 1).redo()
×
24
      true
UNCOV
25
    else false
×
26

27
  def append(change: Change): Unit =
1✔
UNCOV
28
    if (canRedo) changes.remove(redoIndex, changes.size - redoIndex)
×
29
    changes.append(change)
1✔
30
    redoIndex += 1
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc