mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-13 20:27:28 -08:00
parent
274f800ae2
commit
2d3b6e4e23
|
@ -11,7 +11,7 @@ func (j *java) string() string {
|
|||
}
|
||||
|
||||
func (j *java) init(props *properties, env environmentInfo) {
|
||||
javaRegex := `(?: JRE) \((?P<version>(?P<major>[0-9]+)(?:\.(?P<minor>[0-9]+))?(?:\.(?P<patch>[0-9]+))?).*\),`
|
||||
javaRegex := `(?: JRE)(?: \(.*\))? \((?P<version>(?P<major>[0-9]+)(?:\.(?P<minor>[0-9]+))?(?:\.(?P<patch>[0-9]+))?).*\),`
|
||||
javaCmd := &cmd{
|
||||
executable: "java",
|
||||
args: []string{"-Xinternalversion"},
|
||||
|
|
|
@ -15,6 +15,11 @@ func TestJava(t *testing.T) {
|
|||
JavaHomeVersion string
|
||||
JavaHomeEnabled bool
|
||||
}{
|
||||
{
|
||||
Case: "Zulu LTS",
|
||||
ExpectedString: "11.0.13",
|
||||
Version: "OpenJDK 64-Bit Server VM (11.0.13+8-LTS) for windows-amd64 JRE (Zulu11.52+13-CA) (11.0.13+8-LTS), built on Oct 7 2021 16:00:23 by \"zulu_re\" with MS VC++ 15.9 (VS2017)", // nolint:lll
|
||||
},
|
||||
{
|
||||
Case: "OpenJDK macOS",
|
||||
ExpectedString: "1.8.0",
|
||||
|
|
Loading…
Reference in a new issue