cmd(version): check for more errors in the test
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-05-31 21:07:44 +02:00
parent ed72a0db66
commit 0b5559336e
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -5,6 +5,7 @@ package cmd
import (
"bytes"
"errors"
"os"
"regexp"
"testing"
@ -17,9 +18,13 @@ func TestNixFlake_GosrcVersionStringEquivalence(t *testing.T) {
fData, err := os.ReadFile("../flake.nix")
if err != nil {
if errors.Is(err, os.ErrNotExist) {
t.Errorf("Failed to open flake.nix: %q", err)
}
t.Errorf("Error reading flake: %q", err)
}
got := bytes.Contains(fData, []byte(" version = \""+want+"\""))
if !got {