mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-16 13:47:49 -08:00
feat(rust): add beta/dev/nightly to version string
This commit is contained in:
parent
a7a59b8b01
commit
63e20bf53c
|
@ -22,7 +22,7 @@ func (r *Rust) Init(props properties.Properties, env environment.Environment) {
|
||||||
{
|
{
|
||||||
executable: "rustc",
|
executable: "rustc",
|
||||||
args: []string{"--version"},
|
args: []string{"--version"},
|
||||||
regex: `rustc (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+)))`,
|
regex: `rustc (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))(-(?P<prerelease>[a-z]+))?) (\((?P<buildmetadata>[0-9a-f]+ [0-9]+-[0-9]+-[0-9]+)\))`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ func TestRust(t *testing.T) {
|
||||||
Version string
|
Version string
|
||||||
}{
|
}{
|
||||||
{Case: "Rust 1.53.0", ExpectedString: "1.53.0", Version: "rustc 1.53.0 (4369396ce 2021-04-27)"},
|
{Case: "Rust 1.53.0", ExpectedString: "1.53.0", Version: "rustc 1.53.0 (4369396ce 2021-04-27)"},
|
||||||
|
{Case: "Rust 1.66.0", ExpectedString: "1.66.0-nightly", Version: "rustc 1.66.0-nightly (01af5040f 2022-10-04)"},
|
||||||
}
|
}
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
params := &mockedLanguageParams{
|
params := &mockedLanguageParams{
|
||||||
|
|
Loading…
Reference in a new issue