Skip to content

More persist/boltdb.go testing

Christopher Schinnerl requested to merge mnsl:testpersist into master

Created by: mnsl

Fixes up TestOpenDatabase:

  • there is now a broader variety of testInputs and testBuckets
  • testInputs are now hardcoded rather than randomly generated
  • testInputs can thus now be defined via anonymous struct, so type testInput can be removed
  • filepath argument to OpenDatabase is now the full filepath of the database (previously just the file name, dbFilename, was passed in, which meant that the database was created in the wrong directory)

Introduces TestBadFileModeOpenDatabase, which checks that a file with the wrong filemode (less than 0600) will cause OpenDatabase to return a permissions error.

Merge request reports