fix(r): parse 4.2.0 correctly

resolves #2229
This commit is contained in:
Jan De Dobbeleer 2022-05-06 20:19:30 +02:00 committed by Jan De Dobbeleer
parent daf47e80b9
commit 5f19315a66
2 changed files with 2 additions and 1 deletions

View file

@ -14,7 +14,7 @@ func (r *R) Template() string {
}
func (r *R) Init(props properties.Properties, env environment.Environment) {
rRegex := `R (scripting front-end )?version (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+)))`
rRegex := `version (?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+)))`
r.language = language{
env: env,
props: props,

View file

@ -19,6 +19,7 @@ func TestR(t *testing.T) {
HasRexe bool
Version string
}{
{Case: "Rscript 4.2.0", ExpectedString: "4.2.0", HasRscript: true, Version: "Rscript (R) version 4.2.0 (2022-04-22)"},
{Case: "Rscript 4.1.3", ExpectedString: "4.1.3", HasRscript: true, Version: "R scripting front-end version 4.1.3 (2022-03-10)"},
{Case: "Rscript 4.1.3 patched", ExpectedString: "4.1.3", HasRscript: true, Version: "R scripting front-end version 4.1.3 Patched (2022-03-10 r81896)"},
{Case: "Rscript 4.0.0", ExpectedString: "4.0.0", HasRscript: true, Version: "R scripting front-end version 4.0.0 (2020-04-24)"},