Skip to content

Commit

Permalink
Fixing CSVExport, CSVWrite tests
Browse files Browse the repository at this point in the history
  • Loading branch information
foralost committed Feb 25, 2024
1 parent 87f51d8 commit 5b291b9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
2015-01-25,2
2015-01-24,0
2015-01-23,1
2015-01-22,2
2015-01-21,2
2015-01-20,2
2015-01-19,1
2015-01-18,1
2015-01-17,2
2015-01-16,2
2015-01-25,YES_MANUAL
2015-01-24,NO
2015-01-23,YES_AUTO
2015-01-22,YES_MANUAL
2015-01-21,YES_MANUAL
2015-01-20,YES_MANUAL
2015-01-19,YES_AUTO
2015-01-18,YES_AUTO
2015-01-17,YES_MANUAL
2015-01-16,YES_MANUAL
20 changes: 10 additions & 10 deletions uhabits-core/assets/test/csv_export/Checkmarks.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Date,Meditate,Wake up early,
2015-01-25,-1,2,
2015-01-24,-1,0,
2015-01-23,-1,1,
2015-01-22,-1,2,
2015-01-21,-1,2,
2015-01-20,-1,2,
2015-01-19,-1,1,
2015-01-18,-1,1,
2015-01-17,-1,2,
2015-01-16,-1,2,
2015-01-25,UNKNOWN,YES_MANUAL,
2015-01-24,UNKNOWN,NO,
2015-01-23,UNKNOWN,YES_AUTO,
2015-01-22,UNKNOWN,YES_MANUAL,
2015-01-21,UNKNOWN,YES_MANUAL,
2015-01-20,UNKNOWN,YES_MANUAL,
2015-01-19,UNKNOWN,YES_AUTO,
2015-01-18,UNKNOWN,YES_AUTO,
2015-01-17,UNKNOWN,YES_MANUAL,
2015-01-16,UNKNOWN,YES_MANUAL,
6 changes: 3 additions & 3 deletions uhabits-core/assets/test/csv_export/Habits.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Position,Name,Question,Description,NumRepetitions,Interval,Color
001,Meditate,Did you meditate this morning?,,1,1,#FF8F00
002,Wake up early,Did you wake up before 6am?,,2,3,#00897B
Position,Name,Question,Description,NumRepetitions,Interval,Color,Unit,Target Type,Target Value
001,Meditate,Did you meditate this morning?,,1,1,#FF8F00,,AT_LEAST,0.0
002,Wake up early,Did you wake up before 6am?,,2,3,#00897B,,AT_LEAST,0.0
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class HabitsCSVExporterTest : BaseUnitTest() {
file.deleteOnExit()
copyAssetToFile(assetFilename, file)

println(file.path)
println(assetFilename)

assertTrue(
FileUtils.contentEquals(
file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ class HabitListTest : BaseUnitTest() {
list.add(h2)
val expectedCSV =
"""
Position,Name,Question,Description,NumRepetitions,Interval,Color
001,Meditate,Did you meditate this morning?,this is a test description,1,1,#FF8F00
002,Wake up early,Did you wake up before 6am?,,2,3,#AFB42B
Position,Name,Question,Description,NumRepetitions,Interval,Color,Unit,Target Type,Target Value
001,Meditate,Did you meditate this morning?,this is a test description,1,1,#FF8F00,,AT_LEAST,0.0
002,Wake up early,Did you wake up before 6am?,,2,3,#AFB42B,,AT_LEAST,0.0
""".trimIndent()
val writer = StringWriter()
Expand Down

0 comments on commit 5b291b9

Please sign in to comment.