mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Do not quote ini values with error constants
This commit is contained in:
parent
1ecc5fdca3
commit
0cc14f65a2
@ -97,12 +97,9 @@ describe('Utils tests', () => {
|
|||||||
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
|
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
|
||||||
const script_path: string = path.join(runner_dir, 'test.sh');
|
const script_path: string = path.join(runner_dir, 'test.sh');
|
||||||
await utils.writeScript('test.sh', testString);
|
await utils.writeScript('test.sh', testString);
|
||||||
await fs.readFile(
|
fs.readFile(script_path, function (error: Error | null, data: Buffer) {
|
||||||
script_path,
|
expect(testString).toBe(data.toString());
|
||||||
function (error: Error | null, data: Buffer) {
|
});
|
||||||
expect(testString).toBe(data.toString());
|
|
||||||
}
|
|
||||||
);
|
|
||||||
await cleanup(script_path);
|
await cleanup(script_path);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -135,6 +132,17 @@ describe('Utils tests', () => {
|
|||||||
'b=3, 4',
|
'b=3, 4',
|
||||||
'c=5'
|
'c=5'
|
||||||
]);
|
]);
|
||||||
|
expect(await utils.CSVArray('\'a=1,2\', "b=3, 4", c=5, d=~e~')).toEqual([
|
||||||
|
'a=1,2',
|
||||||
|
'b=3, 4',
|
||||||
|
'c=5',
|
||||||
|
"d='~e~'"
|
||||||
|
]);
|
||||||
|
expect(await utils.CSVArray('a=\'1,2\', b="3, 4", c=5')).toEqual([
|
||||||
|
'a=1,2',
|
||||||
|
'b=3, 4',
|
||||||
|
'c=5'
|
||||||
|
]);
|
||||||
expect(await utils.CSVArray('')).toEqual([]);
|
expect(await utils.CSVArray('')).toEqual([]);
|
||||||
expect(await utils.CSVArray(' ')).toEqual([]);
|
expect(await utils.CSVArray(' ')).toEqual([]);
|
||||||
});
|
});
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -1285,7 +1285,7 @@ async function CSVArray(values_csv) {
|
|||||||
return value
|
return value
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^["']|["']$|(?<==)["']/g, '')
|
.replace(/^["']|["']$|(?<==)["']/g, '')
|
||||||
.replace(/=(.*[?{}|&~![()^]+.*)/, "='$1'");
|
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ export async function CSVArray(values_csv: string): Promise<Array<string>> {
|
|||||||
return value
|
return value
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^["']|["']$|(?<==)["']/g, '')
|
.replace(/^["']|["']$|(?<==)["']/g, '')
|
||||||
.replace(/=(.*[?{}|&~![()^]+.*)/, "='$1'");
|
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user