Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhance reading from .python-version#787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
HarithaVattikuti merged 8 commits intoactions:mainfromkrystof-k:main
May 21, 2025
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Update versions inutils.test.ts again
  • Loading branch information
@krystof-k
krystof-k committedMay 20, 2025
commit68b6f20e34d9a78bc29c18484ca0ac8e11733e80
30 changes: 15 additions & 15 deletions__tests__/utils.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,10 +24,10 @@ jest.mock('@actions/core');

describe('validatePythonVersionFormatForPyPy', () => {
it.each([
['3.12', true],
['3.13', true],
['3.14',true],
['3.12.x',false],
['3.13.x', false],
['3.14.x', false],
['3.x', false],
['3', false]
])('%s -> %s', (input, expected) => {
Expand DownExpand Up@@ -101,7 +101,7 @@ describe('Version from file test', () => {
await io.mkdirP(tempDir);
const pythonVersionFileName = 'python-version.file';
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
const pythonVersionFileContent = '3.14';
const pythonVersionFileContent = '3.13';
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
expect(_fn(pythonVersionFilePath)).toEqual([pythonVersionFileContent]);
}
Expand All@@ -112,9 +112,9 @@ describe('Version from file test', () => {
await io.mkdirP(tempDir);
const pythonVersionFileName = 'python-version.file';
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
const pythonVersionFileContent = '3.14\r\n3.13';
const pythonVersionFileContent = '3.13\r\n3.12';
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
expect(_fn(pythonVersionFilePath)).toEqual(['3.14', '3.13']);
expect(_fn(pythonVersionFilePath)).toEqual(['3.13', '3.12']);
}
);
it.each([getVersionsInputFromPlainFile, getVersionInputFromFile])(
Expand All@@ -124,13 +124,13 @@ describe('Version from file test', () => {
const pythonVersionFileName = 'python-version.file';
const pythonVersionFilePath = path.join(tempDir, pythonVersionFileName);
const pythonVersionFileContent =
'3.14/envs/virtualenv\r# 3.14\n3.13\r\n3.12\r\n 3.11 \r\n';
'3.13/envs/virtualenv\r# 3.12\n3.11\r\n3.10\r\n 3.9 \r\n';
fs.writeFileSync(pythonVersionFilePath, pythonVersionFileContent);
expect(_fn(pythonVersionFilePath)).toEqual([
'3.14',
'3.13',
'3.12',
'3.11'
'3.11',
'3.10',
'3.9'
]);
}
);
Expand DownExpand Up@@ -184,9 +184,9 @@ describe('Version from file test', () => {
async _fn => {
const toolVersionFileName = '.tool-versions';
const toolVersionFilePath = path.join(tempDir, toolVersionFileName);
const toolVersionContent = '# python 3.13\npython 3.14';
const toolVersionContent = '# python 3.13\npython 3.12';
fs.writeFileSync(toolVersionFilePath, toolVersionContent);
expect(_fn(toolVersionFilePath)).toEqual(['3.14']);
expect(_fn(toolVersionFilePath)).toEqual(['3.12']);
}
);

Expand All@@ -195,9 +195,9 @@ describe('Version from file test', () => {
async _fn => {
const toolVersionFileName = '.tool-versions';
const toolVersionFilePath = path.join(tempDir, toolVersionFileName);
const toolVersionContent = ' python 3.14 ';
const toolVersionContent = ' python 3.13 ';
fs.writeFileSync(toolVersionFilePath, toolVersionContent);
expect(_fn(toolVersionFilePath)).toEqual(['3.14']);
expect(_fn(toolVersionFilePath)).toEqual(['3.13']);
}
);

Expand All@@ -217,9 +217,9 @@ describe('Version from file test', () => {
async _fn => {
const toolVersionFileName = '.tool-versions';
const toolVersionFilePath = path.join(tempDir, toolVersionFileName);
const toolVersionContent = 'python pypy3.14-7.3.19';
const toolVersionContent = 'python pypy3.10-7.3.19';
fs.writeFileSync(toolVersionFilePath, toolVersionContent);
expect(_fn(toolVersionFilePath)).toEqual(['pypy3.14-7.3.19']);
expect(_fn(toolVersionFilePath)).toEqual(['pypy3.10-7.3.19']);
}
);

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp