cmd(version): check for more errors in the test
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ed72a0db66
commit
0b5559336e
@ -5,6 +5,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"testing"
|
"testing"
|
||||||
@ -17,7 +18,11 @@ func TestNixFlake_GosrcVersionStringEquivalence(t *testing.T) {
|
|||||||
|
|
||||||
fData, err := os.ReadFile("../flake.nix")
|
fData, err := os.ReadFile("../flake.nix")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Failed to open flake.nix: %q", err)
|
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+"\""))
|
got := bytes.Contains(fData, []byte(" version = \""+want+"\""))
|
||||||
|
Loading…
Reference in New Issue
Block a user