Add max-parallelism to test workflow
and add more tests for isPositiveInteger function
This commit is contained in:
parent
4245b3de99
commit
da40211525
|
|
@ -38,6 +38,7 @@ jobs:
|
||||||
files: '**/*.txt'
|
files: '**/*.txt'
|
||||||
replacement-text: '1.0.2'
|
replacement-text: '1.0.2'
|
||||||
exclude: '**/*.check.txt'
|
exclude: '**/*.check.txt'
|
||||||
|
max-parallelism: '1'
|
||||||
|
|
||||||
- name: Replace in Files - replace using special characters
|
- name: Replace in Files - replace using special characters
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|
@ -91,6 +92,26 @@ jobs:
|
||||||
encoding: 'invalid'
|
encoding: 'invalid'
|
||||||
exclude: '**/*.check.txt'
|
exclude: '**/*.check.txt'
|
||||||
|
|
||||||
|
- name: Replace in Files - error on invalid max-parallelism (invalid number)
|
||||||
|
uses: ./
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
search-text: 'foo'
|
||||||
|
files: '**/*.txt'
|
||||||
|
replacement-text: 'bar'
|
||||||
|
exclude: '**/*.check.txt'
|
||||||
|
max-parallelism: '-1'
|
||||||
|
|
||||||
|
- name: Replace in Files - error on invalid max-parallelism (invalid string)
|
||||||
|
uses: ./
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
search-text: 'foo'
|
||||||
|
files: '**/*.txt'
|
||||||
|
replacement-text: 'bar'
|
||||||
|
exclude: '**/*.check.txt'
|
||||||
|
max-parallelism: 'invalid'
|
||||||
|
|
||||||
- name: Verify changes
|
- name: Verify changes
|
||||||
run: |
|
run: |
|
||||||
echo " > Actual - test1.txt"
|
echo " > Actual - test1.txt"
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,22 @@ describe('isPositiveInteger', () => {
|
||||||
it('should return false for non-numeric strings', () => {
|
it('should return false for non-numeric strings', () => {
|
||||||
expect(isPositiveInteger('abc')).toBe(false);
|
expect(isPositiveInteger('abc')).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should return false for empty strings', () => {
|
||||||
|
expect(isPositiveInteger('')).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false for whitespace strings', () => {
|
||||||
|
expect(isPositiveInteger(' ')).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false for null', () => {
|
||||||
|
expect(isPositiveInteger(null as any)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return false for undefined', () => {
|
||||||
|
expect(isPositiveInteger(undefined as any)).toBe(false);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('isValidEncoding', () => {
|
describe('isValidEncoding', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue