-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip tests for broken rand.Reader on Go 1.24+.
Tests involving broken rand.Reader are skipped for Go 1.24 and above due to upstream changes that prevent failures. A `getGoVersion` helper function is added to determine the runtime version, ensuring test compatibility and reducing false negatives. Reference: golang/go#66821.
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package mail | ||
|
||
import ( | ||
"runtime" | ||
"strconv" | ||
"strings" | ||
"testing" | ||
) | ||
|
||
// getGoVersion returns the current Go runtime version as a float64. It fails the test if the version | ||
// parsing encounters an error. | ||
func getGoVersion(t *testing.T) float64 { | ||
t.Helper() | ||
version := runtime.Version() | ||
version = version[2:] | ||
version = version[:strings.LastIndex(version, ".")] | ||
vernum, err := strconv.ParseFloat(version, 64) | ||
if err != nil { | ||
t.Fatalf("failed to parse Go version: %s", err) | ||
} | ||
return vernum | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters