From 5153431d2f11e5de4a129d6014545d32d70f58b1 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 30 Dec 2024 13:30:40 -0300 Subject: tests/dedo.go: Normalize tests - hack extra `os.Remove()` calls to avoid leaving temporary files around; - try using temporary directories that usually live in RAM; - disable broken tests; - stop printing to stdout/stderr; - decrease test constants to make slow tests bearable*. (*): tests are bearable in RAM (~5s) or on SSDs (~10s). HDDs are still too slow for them (~2m). --- src/dedo.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/dedo.go') diff --git a/src/dedo.go b/src/dedo.go index 47d08ca..dcc4956 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -3334,9 +3334,9 @@ func (p *page) branchPageElements() []branchPageElement { } // dump writes n bytes of the page to STDERR as hex output. -func (p *page) hexdump(n int) { +func (p *page) hexdump(n int) string { buf := (*[maxAllocSize]byte)(unsafe.Pointer(p))[:n] - fmt.Fprintf(os.Stderr, "%x\n", buf) + return fmt.Sprintf("%x\n", buf) } type pages []*page @@ -4373,7 +4373,9 @@ func (cmd *InfoCommand) Run(args ...string) error { // Print basic database info. info := db.Info() - fmt.Fprintf(cmd.Stdout, "Page Size: %d\n", info.PageSize) + // FIXME + fmt.Sprintf("Page Size: %d\n", info.PageSize) + return nil } -- cgit v1.2.3