diff --git a/cli.odin b/cli.odin index 5410a3e..419b4bc 100644 --- a/cli.odin +++ b/cli.odin @@ -103,9 +103,10 @@ parse_args :: proc(args: []string, out: io.Stream, err: io.Stream) -> (cmd: Comm } } - if val, ok := cmd.flags["config-file"]; ok { + val: string = --- + if val, ok = cmd.flags["config-file"]; ok { cmd.config_path = val - } else if val, ok := cmd.flags["c"]; ok { + } else if val, ok = cmd.flags["c"]; ok { cmd.config_path = val } else { // FIXME: Handle err diff --git a/cli_test.odin b/cli_test.odin index 97bd0bc..37a2dd4 100644 --- a/cli_test.odin +++ b/cli_test.odin @@ -1,5 +1,6 @@ #+feature dynamic-literals +#+test package main import "core:bufio" diff --git a/cmd_check_test.odin b/cmd_check_test.odin index 591d9dc..133cf2b 100644 --- a/cmd_check_test.odin +++ b/cmd_check_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:fmt" diff --git a/cmd_list_test.odin b/cmd_list_test.odin index 2c34f9b..f9fff31 100644 --- a/cmd_list_test.odin +++ b/cmd_list_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:path/filepath" diff --git a/cmd_nushell_completion_test.odin b/cmd_nushell_completion_test.odin index e97830d..0d91e81 100644 --- a/cmd_nushell_completion_test.odin +++ b/cmd_nushell_completion_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:fmt" diff --git a/config_test.odin b/config_test.odin index ef002f4..3c46136 100644 --- a/config_test.odin +++ b/config_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:fmt" diff --git a/crypto_test.odin b/crypto_test.odin index 5bcbe8c..4f75c24 100644 --- a/crypto_test.odin +++ b/crypto_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:fmt" diff --git a/db.odin b/db.odin index 192ecd7..4baf509 100644 --- a/db.odin +++ b/db.odin @@ -535,8 +535,8 @@ shares_remote :: proc(f: ^EnvFile, remotes: []string) -> bool { get_git_remotes :: proc(dir: string, allocator: mem.Allocator) -> [dynamic]string { config_path, _ := filepath.join({dir, ".git", "config"}, context.temp_allocator) // TODO: Handle error - m, _, ok := ini.load_map_from_path(config_path, context.temp_allocator) - if !ok { + m, _, read_ok := ini.load_map_from_path(config_path, context.temp_allocator) + if !read_ok { return nil } diff --git a/db_integration_test.odin b/db_integration_test.odin index d52f941..a41048b 100644 --- a/db_integration_test.odin +++ b/db_integration_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:fmt" diff --git a/db_test.odin b/db_test.odin index 0671e3e..53a536a 100644 --- a/db_test.odin +++ b/db_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:crypto/hash" @@ -513,7 +514,8 @@ test_db_sync_dir_missing :: proc(t: ^testing.T) { db_insert(&d, f) result, err := db_sync(&d, &f) - testing.expect(t, err == .DirMissing, "should return DirMissing error") + testing.expect_value(t, err, SyncError.DirMissing) + testing.expect_value(t, result, nil) } @(test) diff --git a/scan_test.odin b/scan_test.odin index 35124c9..2076cad 100644 --- a/scan_test.odin +++ b/scan_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:fmt" diff --git a/ssh_test.odin b/ssh_test.odin index 1019af9..73e641a 100644 --- a/ssh_test.odin +++ b/ssh_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:fmt" diff --git a/table_test.odin b/table_test.odin index c8a6909..747ecc1 100644 --- a/table_test.odin +++ b/table_test.odin @@ -1,3 +1,4 @@ +#+test package main import "core:encoding/json"