From 389f6ee74c717e28b99b9418021bb43f0cc972eb Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 7 Jul 2023 23:33:23 +0200 Subject: [PATCH] backup: add minimal test for program versioni --- cmd/restic/cmd_backup_integration_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmd/restic/cmd_backup_integration_test.go b/cmd/restic/cmd_backup_integration_test.go index b81db21e6..fb7bef633 100644 --- a/cmd/restic/cmd_backup_integration_test.go +++ b/cmd/restic/cmd_backup_integration_test.go @@ -440,6 +440,22 @@ func TestBackupTags(t *testing.T) { "expected parent to be %v, got %v", parent.ID, newest.Parent) } +func TestBackupProgramVersion(t *testing.T) { + env, cleanup := withTestEnvironment(t) + defer cleanup() + + testSetupBackupData(t, env) + testRunBackup(t, "", []string{env.testdata}, BackupOptions{}, env.gopts) + newest, _ := testRunSnapshots(t, env.gopts) + + if newest == nil { + t.Fatal("expected a backup, got nil") + } + resticVersion := "restic " + version + rtest.Assert(t, newest.ProgramVersion == resticVersion, + "expected %v, got %v", resticVersion, newest.ProgramVersion) +} + func TestQuietBackup(t *testing.T) { env, cleanup := withTestEnvironment(t) defer cleanup()