mirror of
https://github.com/sbrow/envr.git
synced 2026-06-28 02:58:33 -04:00
chore: Cleaned up code.
This commit is contained in:
21
db_test.odin
21
db_test.odin
@@ -46,12 +46,11 @@ test_db_insert_and_fetch :: proc(t: ^testing.T) {
|
||||
if !ok do return
|
||||
defer sqlite.db_close(d.db)
|
||||
|
||||
f := make_test_env_file(
|
||||
"/project/.env",
|
||||
"abc123",
|
||||
"SECRET=value",
|
||||
[]string{"git@github.com:user/repo.git"},
|
||||
)
|
||||
path := "/project/.env"
|
||||
sha := "abc123"
|
||||
contents := "SECRET=value"
|
||||
|
||||
f := make_test_env_file(path, sha, contents, []string{"git@github.com:user/repo.git"})
|
||||
defer delete(f.Remotes)
|
||||
|
||||
testing.expect(t, db_insert(&d, f), "insert should succeed")
|
||||
@@ -61,11 +60,11 @@ test_db_insert_and_fetch :: proc(t: ^testing.T) {
|
||||
if !fetch_ok do return
|
||||
defer delete(fetched.Remotes)
|
||||
|
||||
testing.expect(t, fetched.Path == "/project/.env", "path mismatch")
|
||||
testing.expect(t, fetched.Sha256 == "abc123", "sha mismatch")
|
||||
testing.expect(t, fetched.contents == "SECRET=value", "contents mismatch")
|
||||
testing.expect(t, len(fetched.Remotes) == 1, "remotes count mismatch")
|
||||
testing.expect(t, fetched.Remotes[0] == "git@github.com:user/repo.git", "remote mismatch")
|
||||
testing.expect_value(t, fetched.Path, path)
|
||||
testing.expect_value(t, fetched.Sha256, sha)
|
||||
testing.expect_value(t, fetched.contents, contents)
|
||||
testing.expect_value(t, len(fetched.Remotes), 1)
|
||||
testing.expect_value(t, fetched.Remotes[0], "git@github.com:user/repo.git")
|
||||
}
|
||||
|
||||
@(test)
|
||||
|
||||
Reference in New Issue
Block a user