mirror of
https://github.com/sbrow/envr.git
synced 2026-06-27 10:38:33 -04:00
refactor: Fixed the rest of the (tested) leaks.
This commit is contained in:
19
db_test.odin
19
db_test.odin
@@ -1,19 +0,0 @@
|
||||
package main
|
||||
|
||||
import "core:path/filepath"
|
||||
import "core:strings"
|
||||
import "core:testing"
|
||||
|
||||
@(test)
|
||||
test_dir_slice_owns_parent :: proc(t: ^testing.T) {
|
||||
abs_path := "/home/user/project/.env"
|
||||
cloned_path, _ := strings.clone(abs_path)
|
||||
|
||||
dir := filepath.dir(cloned_path)
|
||||
|
||||
testing.expect(t, dir == "/home/user/project", "filepath.dir should return parent directory")
|
||||
testing.expect(t, len(dir) > 0, "dir should not be empty")
|
||||
|
||||
cloned_dir, _ := strings.clone(dir)
|
||||
testing.expect(t, cloned_dir == dir, "clone of dir should equal dir")
|
||||
}
|
||||
Reference in New Issue
Block a user