1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Javascript indenting not sufficiently tested.
12 Solution: Add more tests. (Luc Deschenaux) Mark the lines that are indented
14 Files: src/testdir/test3.in, src/testdir/test3.ok
17 *** ../vim-7.3.255/src/testdir/test3.in 2011-07-15 14:12:25.000000000 +0200
18 --- src/testdir/test3.in 2011-07-15 21:05:49.000000000 +0200
67 + ]; // indent 16 less
80 + var class_name='myclass';
82 + function private_method() {
86 + method: function(options,args){
91 + function init(options) {
93 + $(this).data(class_name+'_public',$.extend({},{
95 + bar: 2, // indent 8 more
96 + foobar: [ // indent 8 more
98 + 2, // indent 16 more
101 + callback: function(){ // indent 8 more
102 + return true; // indent 8 more
107 + $.fn[class_name]=function() {
109 + var _arguments=arguments;
110 + return this.each(function(){
112 + var options=$(this).data(class_name+'_public');
114 + init.apply(this,_arguments);
117 + var method=public_method[_arguments[0]];
119 + if (typeof(method)!='function') {
120 + console.log(class_name+' has no method "'+_arguments[0]+'"');
123 + _arguments[0]=options;
124 + method.apply(this,_arguments);
139 + function init(options) {
140 + $(this).data(class_name+'_public',$.extend({},{
144 + 1, // indent 8 more
145 + 2, // indent 8 more
148 + callback: function(){
163 + function init(options) {
164 + $(this).data(class_name+'_public',$.extend({},{
166 + bar: 2, // indent 8 more
167 + foobar: [ // indent 8 more
168 + 1, // indent 8 more
169 + 2, // indent 16 more
170 + 3 // indent 16 more
172 + callback: function(){ // indent 8 more
173 + return true; // indent 8 more
181 :g/^STARTTEST/.,/^ENDTEST/d
182 :1;/start of AUTO/,$wq! test.out
184 *** ../vim-7.3.255/src/testdir/test3.ok 2011-07-15 14:12:25.000000000 +0200
185 --- src/testdir/test3.ok 2011-07-15 21:06:38.000000000 +0200
195 + 1, // indent 8 more
198 + ]; // indent 8 less
208 + ]; // indent 16 less
216 + var class_name='myclass';
218 + function private_method() {
221 + var public_method={
222 + method: function(options,args){
227 + function init(options) {
229 + $(this).data(class_name+'_public',$.extend({},{
231 + bar: 2, // indent 8 more
232 + foobar: [ // indent 8 more
233 + 1, // indent 8 more
234 + 2, // indent 16 more
235 + 3 // indent 16 more
237 + callback: function(){ // indent 8 more
238 + return true; // indent 8 more
243 + $.fn[class_name]=function() {
245 + var _arguments=arguments;
246 + return this.each(function(){
248 + var options=$(this).data(class_name+'_public');
250 + init.apply(this,_arguments);
253 + var method=public_method[_arguments[0]];
255 + if (typeof(method)!='function') {
256 + console.log(class_name+' has no method "'+_arguments[0]+'"');
259 + _arguments[0]=options;
260 + method.apply(this,_arguments);
270 + function init(options) {
271 + $(this).data(class_name+'_public',$.extend({},{
275 + 1, // indent 8 more
276 + 2, // indent 8 more
279 + callback: function(){
289 + function init(options) {
290 + $(this).data(class_name+'_public',$.extend({},{
292 + bar: 2, // indent 8 more
293 + foobar: [ // indent 8 more
294 + 1, // indent 8 more
295 + 2, // indent 16 more
296 + 3 // indent 16 more
298 + callback: function(){ // indent 8 more
299 + return true; // indent 8 more
306 *** ../vim-7.3.255/src/version.c 2011-07-20 15:04:52.000000000 +0200
307 --- src/version.c 2011-07-20 15:08:13.000000000 +0200
311 { /* Add new patch number below this line */
317 Not too long ago, a keyboard was something to make music with...
319 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
320 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
321 \\\ an exciting new programming language -- http://www.Zimbu.org ///
322 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///