Skip to content

Commit

Permalink
Add #THISWILLSELFDESTRUCT to list of ignored points (#457)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
theospears authored Jun 2, 2024
1 parent f0358f0 commit dd1775d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion BeeKit/Goal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public class Goal {
for dataPoint in recentData.reversed() {
let comment = dataPoint.comment
// Ignore data points with comments suggesting they aren't a real value
if comment.contains("#DERAIL") || comment.contains("#SELFDESTRUCT") || comment.contains("#RESTART") || comment.contains("#TARE") {
if comment.contains("#DERAIL") || comment.contains("#SELFDESTRUCT") || comment.contains("#THISWILLSELFDESTRUCT") || comment.contains("#RESTART") || comment.contains("#TARE") {
continue
}
return dataPoint.value
Expand Down
1 change: 1 addition & 0 deletions BeeSwiftTests/GoalTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ final class GoalTests: XCTestCase {
testJSON["recent_data"] = [
["value": 0, "daystamp": "20221131", "comment": "Goal #RESTART Point"],
["value": 0, "daystamp": "20221131", "comment": "This will #SELFDESTRUCT"],
["value": 0, "daystamp": "20221131", "comment": "PESSIMISTIC PRESUMPTION #THISWILLSELFDESTRUCT"],
["value": 0, "daystamp": "20221130", "comment": "#DERAIL ON THE 1st"],
["value": 2, "daystamp": "20221126"],
["value": 3.5, "daystamp": "20221125"],
Expand Down

0 comments on commit dd1775d

Please sign in to comment.