~whynothugo/sb-backup

sb-backup/main_test.go -rw-r--r-- 587 bytes
01f9297c — Hugo Osvaldo Barrera Include a licence for this project 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main

import (
	"testing"
)

func TestFilenameWithExtension(t *testing.T) {
	name := "arch.efi"
	expected := "arch_backup.efi"
	actual := GenerateBackupFilename(name)

	if actual != expected {
		t.Fatalf(
			"GenerateBackupFilename(%s) returned %s, expected %s.",
			name,
			actual,
			expected,
		)
	}
}

func TestFilenameWithoutExtension(t *testing.T) {
	name := "arch"
	expected := "arch_backup"
	actual := GenerateBackupFilename(name)

	if actual != expected {
		t.Fatalf(
			"GenerateBackupFilename(%s) returned %s, expected %s.",
			name,
			actual,
			expected,
		)
	}
}