2019-02-11 14:26:13 +01:00
|
|
|
package sources
|
|
|
|
|
|
|
|
|
|
import (
|
2025-11-29 23:14:46 -05:00
|
|
|
"net/http"
|
2019-02-11 14:26:13 +01:00
|
|
|
"regexp"
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestArchLinuxGetLatestRelease(t *testing.T) {
|
2025-11-29 23:14:46 -05:00
|
|
|
src := &archlinux{}
|
|
|
|
|
src.client = http.DefaultClient
|
2019-02-11 14:26:13 +01:00
|
|
|
|
2021-07-21 09:56:23 -04:00
|
|
|
release, err := src.getLatestRelease("https://archive.archlinux.org/iso/", "x86_64")
|
2019-02-11 14:26:13 +01:00
|
|
|
require.NoError(t, err)
|
|
|
|
|
require.Regexp(t, regexp.MustCompile(`^\d{4}\.\d{2}\.\d{2}$`), release)
|
|
|
|
|
}
|