Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 997bcc2

Browse files
committed
simplified test cases
1 parent fefbab2 commit 997bcc2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/text-buffer-spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ describe('when a buffer is already open', () => {
1313
expect(buffer.getText()).toBe('bar(x)')
1414
})
1515

16-
describe('should properly replace regex literals', () => {
17-
it('replaces tstat_fvars()->curr_setpoint[HEAT_EN] = new_tptr->heat_limit; with tstat_set_curr_setpoint(HEAT_EN, new_tptr->heat_limit);', () => {
16+
describe('Texts should be replaced properly with strings containing literals when using the regex option', () => {
17+
it('replaces tstat_fvars()->curr_setpoint[HEAT_EN] with tstat_set_curr_setpoint($1, $2);', () => {
1818
buffer.setPath(filePath)
1919
buffer.setText('tstat_fvars()->curr_setpoint[HEAT_EN] = new_tptr->heat_limit;')
2020
buffer.replace(/tstat_fvars\(\)->curr_setpoint\[(.+?)\] = (.+?);/, 'tstat_set_curr_setpoint($1, $2);')
2121

2222
expect(buffer.getText()).toBe('tstat_set_curr_setpoint(HEAT_EN, new_tptr->heat_limit);')
2323
})
2424

25-
it('replaces atom/flight-manual.atom.io with atom/flight-manualatomio', () => {
26-
buffer.setText('atom/flight-manual.atom.io')
27-
buffer.replace(/\.(atom)\./, '$1')
25+
it('replaces atom/flight-manualatomio with $1', () => {
26+
buffer.setText('atom/flight-manualatomio')
27+
buffer.replace($1, '$1')
2828

2929
expect(buffer.getText()).toBe('atom/flight-manualatomio')
3030
})

0 commit comments

Comments
 (0)