Sha256: 8c4a7f18eeda7885728724ae1a7a9085f1444fa5be0e4ddad895c3dea7da870b

Contents?: true

Size: 550 Bytes

Versions: 72

Compression:

Stored size: 550 Bytes

Contents

'use strict';
/*jshint asi: true*/

var test = require('tap').test
  , util = require('util')
  , redeyed = require('..')

function inspect (obj) {
  return util.inspect(obj, false, 5, true)
}

test('properly handles script level return -- no blow up', function (t) {
  var code = [
      , 'return 1;'
      ].join('\n')
    , opts = { Keyword: { 'return': '%:^' } }
    , expected = '\n%return^ 1;'
    , res = redeyed(code, opts).code

  t.equals(res, expected, inspect(code) + ' opts: ' + inspect(opts) + ' => ' + inspect(expected))
  t.end()
})

Version data entries

72 entries across 72 versions & 3 rubygems

Version Path
ilog-0.4.1 node_modules/redeyed/test/redeyed-script-level-return.js
ilog-0.4.0 node_modules/redeyed/test/redeyed-script-level-return.js
ilog-0.3.3 node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.18 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.17 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.16 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.15 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.14 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.13 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.12 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.11 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.10 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.9 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.8 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js
trusty-festivity-extension-2.5.7 node_modules/bower/node_modules/cardinal/node_modules/redeyed/test/redeyed-script-level-return.js