Changeset 298
- Timestamp:
- 02/16/08 17:09:23 (5 months ago)
- Files:
-
- trunk/src/ingy/JS-Test-Base/lib/Test/Base.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ingy/JS-Test-Base/lib/Test/Base.js
r296 r298 13 13 this.state.filters_map = {}; 14 14 this.state.blocks = []; 15 this.block_delim = '==='; 16 this.section_delim = '---'; 15 17 } 16 18 … … 111 113 112 114 var chunks = []; 113 while (hunk.indexOf('\n---') >= 0) { 114 index = hunk.indexOf('\n---') + 1; 115 var delim = this.section_delim; 116 while (hunk.indexOf('\n' + delim) >= 0) { 117 index = hunk.indexOf('\n' + delim) + 1; 115 118 var chunk = hunk.substr(0, index); 116 119 hunk = hunk.substr(index); … … 119 122 chunks.push(hunk); 120 123 124 delim = delim.replace(/[\+]/g, '\\+'); 121 125 for (var i = 0; i < chunks.length; i++) { 122 126 var chunk = chunks[i]; … … 125 129 var line1 = chunk.substr(0, index); 126 130 var section_data = chunk.substr(index + 1); 127 line1 = line1.replace( /^---\s*/, '');131 line1 = line1.replace(new RegExp('^' + delim + '\\s*'), ''); 128 132 if (! line1.length) throw('xxx2'); 129 133 var section_name = '';
