StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
StackGenVis/frontend/node_modules/redeyed/test/redeyed-mixed.js

46 lines
1.2 KiB

'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('adding custom asserts ... ', function (t) {
t.constructor.prototype.assertSurrounds = function (code, opts, expected) {
var result = redeyed(code, opts).code
this.equals(result, expected, inspect(code) + ' => ' + inspect(expected))
return this;
}
t.end()
})
test('\nmixed config, keywords', function (t) {
var opts001 = {
Keyword: {
'this': function (s) { return '_' + s; }
, 'if': { _before: '^' }
, _default: '*:&'
}
};
t.test('\n# ' + inspect(opts001), function (t) {
t.assertSurrounds('if (this.hello) return "world";', opts001, '^if& (_this.hello) *return& "world";').end()
})
var opts002 = {
Keyword: {
'this': function (s) { return '_' + s; }
, 'if': { _before: '^' }
, 'return': ':)'
, _default: ':&'
}
, _default: '*:&'
};
t.test('\n# ' + inspect(opts002), function (t) {
t.assertSurrounds('if (this.hello) return "world";', opts002, '^if& (_this.hello) *return) "world";').end()
})
})