Skip to content

Commit 89f0938

Browse files
chore: enable 7 previously-skipped MagicString tests (#8771)
## Summary - Enable 7 upstream MagicString tests that now pass with the slice fix from the parent PR - **preserves intended order** (3 tests): append/prepend ordering with slice - **should allow contiguous but non-overlapping replacements** (2 tests): overwrite & update - **should not remove content inserted after the end of removed range** (1 test) - **should works** (1 test): hasChanged with clone ## Changes - Updated download-tests.mjs skip patterns: removed 4 entries, narrowed overlapping replacements to error if overlapping replacements so the contiguous test is no longer caught - Regenerated MagicString.test.ts with the updated skip configuration - Test count: 142 → 149 passing, 61 → 54 skipped ## Test plan - [x] All 149 MagicString tests pass - [x] Regenerated test file from download-tests.mjs produces identical results
1 parent ec68fd7 commit 89f0938

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packages/rolldown/tests/magic-string/MagicString.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('MagicString', () => {
4444
});
4545

4646
describe('(ap|pre)pend(Left|Right)', () => {
47-
it.skip('preserves intended order', () => {
47+
it('preserves intended order', () => {
4848
const s = new MagicString('0123456789');
4949

5050
s.appendLeft(5, 'A');
@@ -78,7 +78,7 @@ describe('MagicString', () => {
7878
assert.equal(s.slice(5), '])cba>}56789');
7979
});
8080

81-
it.skip('preserves intended order at beginning of string', () => {
81+
it('preserves intended order at beginning of string', () => {
8282
const s = new MagicString('x');
8383

8484
s.appendLeft(0, '1');
@@ -89,7 +89,7 @@ describe('MagicString', () => {
8989
assert.equal(s.toString(), '4213x');
9090
});
9191

92-
it.skip('preserves intended order at end of string', () => {
92+
it('preserves intended order at end of string', () => {
9393
const s = new MagicString('x');
9494

9595
s.appendRight(1, '1');
@@ -961,7 +961,7 @@ describe('MagicString', () => {
961961
assert.equal(s.toString(), 'abcdefyes');
962962
});
963963

964-
it.skip('should allow contiguous but non-overlapping replacements', () => {
964+
it('should allow contiguous but non-overlapping replacements', () => {
965965
const s = new MagicString('abcdefghijkl');
966966

967967
s.overwrite(3, 6, 'DEF');
@@ -1102,7 +1102,7 @@ describe('MagicString', () => {
11021102
assert.equal(s.toString(), 'abcdefyes');
11031103
});
11041104

1105-
it.skip('should allow contiguous but non-overlapping replacements', () => {
1105+
it('should allow contiguous but non-overlapping replacements', () => {
11061106
const s = new MagicString('abcdefghijkl');
11071107

11081108
s.update(3, 6, 'DEF');
@@ -1311,7 +1311,7 @@ describe('MagicString', () => {
13111311
assert.equal(s.toString(), 'abhi');
13121312
});
13131313

1314-
it.skip('should not remove content inserted after the end of removed range', () => {
1314+
it('should not remove content inserted after the end of removed range', () => {
13151315
const s = new MagicString('ab.c;');
13161316

13171317
s.prependRight(0, '(');
@@ -1801,7 +1801,7 @@ describe('MagicString', () => {
18011801
});
18021802

18031803
describe('hasChanged', () => {
1804-
it.skip('should works', () => {
1804+
it('should works', () => {
18051805
const s = new MagicString(' abcde fghijkl ');
18061806

18071807
assert.ok(!s.hasChanged());

packages/rolldown/tests/magic-string/download-tests.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ const SKIP_TESTS = [
9999
'storeName', // storeName option not supported
100100
'contentOnly', // contentOnly option not supported
101101
'should remove overlapping ranges', // overlapping replacements cause panic
102-
'overlapping replacements', // overlapping replacements cause panic
102+
'error if overlapping replacements', // overlapping replacements cause panic
103+
// Note: 'should allow contiguous but non-overlapping replacements' now works
103104
'already been edited', // Cannot split a chunk that has already been edited
104105
'non-zero-length inserts inside', // causes split chunk panic
105106
'should remove modified ranges', // causes split chunk panic
106107

107108
'should replace then remove', // causes split chunk panic
108-
'preserves intended order', // complex append/prepend ordering with slice
109+
// Note: 'preserves intended order' now works (append/prepend ordering with slice)
109110
// Note: 'excluded characters' (indent exclude option) is now supported
110111
// remove-specific skips
111112
'should remove everything', // edge case
@@ -122,7 +123,7 @@ const SKIP_TESTS = [
122123
// remove-specific complex cases
123124
// Note: "removes across moved content" appears in both remove and reset sections
124125
// The reset version passes, so we handle this with a special transformation below
125-
'should not remove content inserted', // complex interaction
126+
// Note: 'should not remove content inserted after the end of removed range' now works
126127
'should remove interior inserts', // causes panic
127128
// Note: 'should provide a useful error' now works — errors are properly thrown, not panicked
128129
// slice-specific skips
@@ -132,9 +133,8 @@ const SKIP_TESTS = [
132133
// Note: 'should clone filename info' now works since filename is supported
133134
// Note: 'should clone indentExclusionRanges' now works since indentExclusionRanges is supported
134135
'should clone sourcemapLocations', // uses sourcemapLocations
135-
// hasChanged tests that use clone
136-
'should not report change if content is identical', // uses clone
137-
'should works', // uses clone
136+
// Note: 'should works' (hasChanged) now works — clone preserves hasChanged state
137+
// Note: 'should not report change if content is identical' no longer in upstream tests
138138
// replace/replaceAll tests that use regex or function replacer
139139
'works with global regex replace', // regex not supported
140140
'works with global regex replace $$', // regex not supported

0 commit comments

Comments
 (0)