Skip to content

Commit

Permalink
✅ add tests for prefix and suffix extensions for String.
Browse files Browse the repository at this point in the history
  • Loading branch information
BirjuVachhani committed Aug 10, 2024
1 parent 5338b0c commit 6907f50
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/string_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,16 @@ void main() {
expect(r'(\d+'.isRegex, isFalse);
expect(r'\d+'.isRegex, isTrue);
});

test('prefix tests', () {
expect('Save'.prefix('icon'), 'iconSave');
expect('iconSave'.prefix('icon'), 'iconSave');
expect('iconSave'.prefix('icon', force: true), 'iconiconSave');
});

test('suffix tests', () {
expect('save'.suffix('Icon'), 'saveIcon');
expect('saveIcon'.suffix('Icon'), 'saveIcon');
expect('saveIcon'.suffix('Icon', force: true), 'saveIconIcon');
});
}

0 comments on commit 6907f50

Please sign in to comment.