package recovery

import (
	"testing"
)

func TestFindMaxVersion(t *testing.T) {
	result, err := findFileLatestVersion(".", "wal_")
	if err != nil {
		t.Fatal(err)
	}
	if result.Name != "test.wal_123" {
		t.Fatalf("wrong file name %s instead of test.wal_123", result.Name)
	}
	if result.Version != 123 {
		t.Fatalf("wrong file version %d instead of 123", result.Version)
	}
}
