@@ -140,6 +140,19 @@ describe('Version from file test', () => {
140
140
expect ( _fn ( pythonVersionFilePath ) ) . toEqual ( [ pythonVersion ] ) ;
141
141
}
142
142
) ;
143
+ it . each ( [ getVersionInputFromTomlFile , getVersionInputFromFile ] ) (
144
+ 'Version from mise .mise.toml array test' ,
145
+ async _fn => {
146
+ await io . mkdirP ( tempDir ) ;
147
+ const pythonVersionFileName = '.mise.toml' ;
148
+ const pythonVersionFilePath = path . join ( tempDir , pythonVersionFileName ) ;
149
+ const pythonVersion = '3.7.0' ;
150
+ const otherPythonVersion = '3.6.0' ;
151
+ const pythonVersionFileContent = `[tools]\npython = ["${ pythonVersion } ", "${ otherPythonVersion } "]` ;
152
+ fs . writeFileSync ( pythonVersionFilePath , pythonVersionFileContent ) ;
153
+ expect ( _fn ( pythonVersionFilePath ) ) . toEqual ( [ pythonVersion ] ) ;
154
+ }
155
+ ) ;
143
156
it . each ( [ getVersionInputFromTomlFile , getVersionInputFromFile ] ) (
144
157
'Version from mise verbose .mise.toml test' ,
145
158
async _fn => {
@@ -152,6 +165,19 @@ describe('Version from file test', () => {
152
165
expect ( _fn ( pythonVersionFilePath ) ) . toEqual ( [ pythonVersion ] ) ;
153
166
}
154
167
) ;
168
+ it . each ( [ getVersionInputFromTomlFile , getVersionInputFromFile ] ) (
169
+ 'Version from mise verbose .mise.toml array test' ,
170
+ async _fn => {
171
+ await io . mkdirP ( tempDir ) ;
172
+ const pythonVersionFileName = '.mise.toml' ;
173
+ const pythonVersionFilePath = path . join ( tempDir , pythonVersionFileName ) ;
174
+ const pythonVersion = '3.7.0' ;
175
+ const otherPythonVersion = '3.6.0' ;
176
+ const pythonVersionFileContent = `[tools]\npython = [{ version="${ pythonVersion } ", virtualenv=".venv" }, { version="${ otherPythonVersion } ", virtualenv=".venv2" }]` ;
177
+ fs . writeFileSync ( pythonVersionFilePath , pythonVersionFileContent ) ;
178
+ expect ( _fn ( pythonVersionFilePath ) ) . toEqual ( [ pythonVersion ] ) ;
179
+ }
180
+ ) ;
155
181
it . each ( [ getVersionInputFromTomlFile , getVersionInputFromFile ] ) (
156
182
'Version undefined' ,
157
183
async _fn => {
0 commit comments