Skip to content

Commit dd1775d

Browse files
authored
Add #THISWILLSELFDESTRUCT to list of ignored points (#457)
Apparently pessimistic presumptive data points now look like `PESSIMISTIC PRESUMPTION #THISWILLSELFDESTRUCT` which means the app was not ignoring them. Add to the list of ignored strings to include these. Testing: Updated the unit tests to include this case.
1 parent f0358f0 commit dd1775d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

BeeKit/Goal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public class Goal {
145145
for dataPoint in recentData.reversed() {
146146
let comment = dataPoint.comment
147147
// Ignore data points with comments suggesting they aren't a real value
148-
if comment.contains("#DERAIL") || comment.contains("#SELFDESTRUCT") || comment.contains("#RESTART") || comment.contains("#TARE") {
148+
if comment.contains("#DERAIL") || comment.contains("#SELFDESTRUCT") || comment.contains("#THISWILLSELFDESTRUCT") || comment.contains("#RESTART") || comment.contains("#TARE") {
149149
continue
150150
}
151151
return dataPoint.value

BeeSwiftTests/GoalTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ final class GoalTests: XCTestCase {
135135
testJSON["recent_data"] = [
136136
["value": 0, "daystamp": "20221131", "comment": "Goal #RESTART Point"],
137137
["value": 0, "daystamp": "20221131", "comment": "This will #SELFDESTRUCT"],
138+
["value": 0, "daystamp": "20221131", "comment": "PESSIMISTIC PRESUMPTION #THISWILLSELFDESTRUCT"],
138139
["value": 0, "daystamp": "20221130", "comment": "#DERAIL ON THE 1st"],
139140
["value": 2, "daystamp": "20221126"],
140141
["value": 3.5, "daystamp": "20221125"],

0 commit comments

Comments
 (0)