How to use helper method in fast-check-monorepo

Best JavaScript code snippet using fast-check-monorepo

mouse-helper.js

Source:mouse-helper.js Github

copy

Full Screen

1/* global jQuery:false */2(function() {3 "use strict";4 var requestAnimationFrame = window.requestAnimationFrame5 || window.webkitRequestAnimationFrame6 || window.mozRequestAnimationFrame7 || window.oRequestAnimationFrame8 || window.msRequestAnimationFrame9 || null;10 var mouseX = null, mouseY = null,11 realX = null, realY = null,12 destX = 0, destY = 0;13 var mouse_helper_timeout = 0,14 mouse_helper_target = null,15 mouse_helper_last_target = null,16 mouse_helper_action = '',17 mouse_helper_last_action = '',18 mouse_helper_blend_mode = '',19 mouse_helper_color = '',20 mouse_helper_bg_color = '',21 mouse_helper_bd_color = '',22 mouse_helper_callback = '',23 mouse_helper_axis = 'xy',24 mouse_helper_delay = 1;25 var $window = jQuery( window ),26 _window_height = $window.height(),27 _window_width = $window.width(),28 _window_scroll_top = $window.scrollTop(),29 _window_scroll_left = $window.scrollLeft(),30 $document = jQuery( document ),31 $body = jQuery( 'body' ),32 $mouse_helper = jQuery('.trx_addons_mouse_helper');33 var $mouse_helper_targets,34 $mouse_helper_magnets;35 // Update links and values after the new post added36 $document.on( 'action.got_ajax_response', update_jquery_links );37 $document.on( 'action.init_hidden_elements', update_jquery_links );38 var first_run = true;39 function update_jquery_links(e) {40 if ( first_run && e && e.namespace == 'init_hidden_elements' ) {41 first_run = false;42 return; 43 }44 $mouse_helper_targets = jQuery('[data-mouse-helper]');45 $mouse_helper_magnets = jQuery('[data-mouse-helper-magnet]:not([data-mouse-helper-magnet="0"])');46 }47 update_jquery_links();48 // Update global values49 $document.on( 'action.scroll_trx_addons', function() {50 _window_scroll_top = $window.scrollTop();51 } );52 $document.on( 'action.resize_trx_addons', function() {53 _window_height = $window.height();54 _window_width = $window.width();55 _window_scroll_top = $window.scrollTop();56 _window_scroll_left = $window.scrollLeft();57 } );58 // Init Mouse helper59 $document.on('action.init_trx_addons', function() {60 if ( TRX_ADDONS_STORAGE['mouse_helper'] > 0 && $mouse_helper.length > 0 && requestAnimationFrame ) {61 mouse_helper_blend_mode = $mouse_helper.css( 'mix-blend-mode' );62 mouse_helper_color = $mouse_helper.css( 'color' );63 mouse_helper_bg_color = $mouse_helper.css( 'background-color' );64 mouse_helper_bd_color = $mouse_helper.css( 'border-color' );65 mouse_helper_delay = TRX_ADDONS_STORAGE['mouse_helper_delay'];66 $document67 .on( 'mousemove', function(e) {68 trx_addons_mouse_helper_get_state(e);69 if ( mouse_helper_callback && typeof window[mouse_helper_callback] == 'function' ) {70 window[mouse_helper_callback]( 'mousemove', $mouse_helper, mouse_helper_target, e );71 } else if ( typeof window['trx_addons_mouse_helper_callback_' + mouse_helper_action] == 'function' ) {72 window['trx_addons_mouse_helper_callback_' + mouse_helper_action]( 'mousemove', $mouse_helper, mouse_helper_target, e );73 }74 if ( mouse_helper_action == 'highlight' && mouse_helper_target ) {75 var targetOffset = mouse_helper_target.offset(),76 targetX = targetOffset.left - _window_scroll_left,77 targetY = targetOffset.top - _window_scroll_top,78 size = parseFloat(mouse_helper_target.css('background-size').split(' ')[0])/2;79 mouse_helper_target.css('background-position', (mouseX-targetX-size)+'px '+(mouseY-targetY-size)+'px');80 }81 if ( _window_width >= TRX_ADDONS_STORAGE['mobile_breakpoint_mousehelper_off'] ) {82 if ( mouse_helper_delay < 2 ) {83 destX = mouseX;84 destY = mouseY;85 $mouse_helper.css("transform", "translate(" + destX + "px," + destY + "px)");86 }87 if ( mouseX > _window_width - 100 ) {88 if ( ! $mouse_helper.hasClass( 'trx_addons_mouse_helper_left' ) ) {89 $mouse_helper.addClass( 'trx_addons_mouse_helper_left' );90 }91 } else {92 if ( $mouse_helper.hasClass( 'trx_addons_mouse_helper_left' ) ) {93 $mouse_helper.removeClass( 'trx_addons_mouse_helper_left' );94 }95 }96 if ( mouseY > _window_height - 100 ) {97 if ( ! $mouse_helper.hasClass( 'trx_addons_mouse_helper_top' ) ) {98 $mouse_helper.addClass( 'trx_addons_mouse_helper_top' );99 }100 } else {101 if ( $mouse_helper.hasClass( 'trx_addons_mouse_helper_top' ) ) {102 $mouse_helper.removeClass( 'trx_addons_mouse_helper_top' );103 }104 }105 // Check magnets106 trx_addons_mouse_helper_check_magnets();107 }108 } )109 .on("mouseenter", '[data-mouse-helper]', function(e) {110 var $self = jQuery(this).addClass('trx_addons_mouse_helper_over');111 mouse_helper_target = mouse_helper_last_target = $self;112 mouse_helper_action = mouse_helper_last_action = $self.data( 'mouse-helper' );113 if ( _window_width >= TRX_ADDONS_STORAGE['mobile_breakpoint_mousehelper_off'] ) {114 mouse_helper_reset();115 if ( mouse_helper_timeout ) {116 clearTimeout( mouse_helper_timeout );117 mouse_helper_timeout = 0;118 }119 }120 mouse_helper_callback = $self.data( 'mouse-helper-callback' );121 if ( mouse_helper_callback === undefined ) {122 mouse_helper_callback = '';123 }124 if ( mouse_helper_callback && typeof window[mouse_helper_callback] == 'function' ) {125 window[mouse_helper_callback]( 'mouseenter', $mouse_helper, $self, e );126 } else if ( typeof window['trx_addons_mouse_helper_callback_' + mouse_helper_action] == 'function' ) {127 window['trx_addons_mouse_helper_callback_' + mouse_helper_action]( 'mouseenter', $mouse_helper, $self, e );128 }129 mouse_helper_axis = $self.data( 'mouse-helper-axis' );130 if ( mouse_helper_axis === undefined ) {131 mouse_helper_axis = 'xy';132 }133 mouse_helper_delay = $self.data( 'mouse-helper-delay' );134 if ( mouse_helper_delay === undefined ) {135 mouse_helper_delay = TRX_ADDONS_STORAGE['mouse_helper_delay'];136 }137 138 trx_addons_mouse_helper_get_state(e);139 if ( _window_width >= TRX_ADDONS_STORAGE['mobile_breakpoint_mousehelper_off'] ) {140 // Centered141 var pos = TRX_ADDONS_STORAGE['mouse_helper_centered'] > 0 || $self.data("mouse-helper-centered") > 0 || '';142 if ( pos > 0 ) {143 $mouse_helper144 .addClass( 'trx_addons_mouse_helper_centered' );145 }146 // Overlay mode147 var mode = $self.data("mouse-helper-mode") || '';148 if ( mode ) {149 $mouse_helper.css( 'mix-blend-mode', mode );150 }151 // Text color152 var color = $self.data("mouse-helper-color") || '';153 if ( color ) {154 $mouse_helper.css( 'color', color );155 }156 // Background color157 var bg_color = $self.data("mouse-helper-bg-color") || '';158 if ( bg_color ) {159 $mouse_helper.css( 'background-color', bg_color );160 }161 // Border color162 var bd_color = $self.data("mouse-helper-bd-color") || '';163 if ( bd_color ) {164 $mouse_helper.css( 'border-color', bd_color );165 }166 // Add image167 var img = $self.data("mouse-helper-image") || '';168 if ( img ) {169 $mouse_helper170 .find('.trx_addons_mouse_helper_image').remove().end()171 .append( '<span class="trx_addons_mouse_helper_image" style="background-image:url(' + img + ');"></span>' )172 .addClass( "trx_addons_mouse_helper_with_image");173 }174 // Add icon175 var icon = $self.data("mouse-helper-icon") || '';176 if ( icon ) {177 var icon_color = $self.data("mouse-helper-icon-color") || '',178 icon_size = $self.data("mouse-helper-icon-size") || '';179 $mouse_helper180 .find('.trx_addons_mouse_helper_icon').remove().end()181 .append( '<span class="trx_addons_mouse_helper_icon ' + icon + '"'182 + ' style="'183 + ( icon_color ? 'color: ' + icon_color + ';' : '' )184 + ( icon_size ? 'font-size: ' + icon_size + 'em;' : '' )185 + '"'186 +'></span>' )187 .addClass( 'trx_addons_mouse_helper_with_icon' );188 }189 // Add text190 var text = $self.data("mouse-helper-text") || '',191 text_round = $self.data("mouse-helper-text-round") > 0 || false,192 text_size = $self.data("mouse-helper-text-size") || '';193 if ( text ) {194 $mouse_helper195 .find('.trx_addons_mouse_helper_text').remove().end()196 .append( '<span class="trx_addons_mouse_helper_text' + ( text_round ? ' trx_addons_mouse_helper_text_round' : '' ) + '"'197 + ( text_size ? ' style="font-size:' + text_size + 'em;"' : '' )198 + '>'199 + ( text_round ? trx_addons_wrap_chars( text, '<span class="trx_addons_mouse_helper_text_round_item">', '</span>' ) : text )200 + '</span>' )201 .addClass( 'trx_addons_mouse_helper_with_text' + ( text_round ? ' trx_addons_mouse_helper_with_text_round' : '' ) );202 if ( text_round ) {203 var rtl = $body.hasClass( 'rtl' );204 setTimeout( function() {205 var text_wrap = $mouse_helper.find( '.trx_addons_mouse_helper_text' ),206 items = text_wrap.find( '.trx_addons_mouse_helper_text_round_item' );207 if ( items.length > 0) {208 var r = Math.ceil( text_wrap.width() / 2 ),209 a = 0,210 hide = false;211 items.each( function( idx ) {212 if ( hide ) {213 items.eq( idx ).hide();214 } else {215 if ( a >= ( rtl ? 310 : 330 ) ) { // If fill whole round - hide rest chars and replace its with '...'216 items.eq( idx ).html('&hellip;');217 hide = true;218 }219 var x = r + r * Math.sin( a / 180 * Math.PI ),220 y = r - r * Math.cos( a / 180 * Math.PI ),221 css = {222 'transform': 'rotate(' + ( rtl ? -a : a ) + 'deg)',223 'top': y + 'px'224 };225 if ( rtl ) {226 css.right = x + 'px';227 } else {228 css.left = x + 'px';229 }230 items.eq( idx ).css( css );231 a += 2 * Math.asin( ( items.eq( idx ).width() + ( rtl ? 3 : 3 ) ) / ( 2 * r ) ) * 180 / Math.PI;232 }233 } );234 }235 }, 350);236 }237 }238 // Add custom HTML code239 var layout = $self.data("mouse-helper-layout") || '';240 if ( layout ) {241 $mouse_helper242 .find('.trx_addons_mouse_helper_layout').remove().end()243 .append( '<span class="trx_addons_mouse_helper_layout">' + layout + '</span>' )244 .addClass( 'trx_addons_mouse_helper_with_layout' );245 }246 // Set 'active' and 'action' classes247 $mouse_helper.addClass( "trx_addons_mouse_helper_active trx_addons_mouse_helper_action_" + mouse_helper_action);248 }249 } )250 .on("mouseleave", '[data-mouse-helper]', function(e) {251 if ( mouse_helper_callback && typeof window[mouse_helper_callback] == 'function' ) {252 window[mouse_helper_callback]( 'mouseleave', $mouse_helper, mouse_helper_target, e );253 mouse_helper_callback = '';254 } else if ( typeof window['trx_addons_mouse_helper_callback_' + mouse_helper_action] == 'function' ) {255 window['trx_addons_mouse_helper_callback_' + mouse_helper_action]( 'mouseleave', $mouse_helper, mouse_helper_target, e );256 }257 $mouse_helper.removeClass( 'trx_addons_mouse_helper_click'258 + ' trx_addons_mouse_helper_action_' + mouse_helper_action259 );260 if ( mouse_helper_target ) {261 mouse_helper_target.removeClass('trx_addons_mouse_helper_over');262 }263 mouse_helper_target = null;264 mouse_helper_action = '';265 mouse_helper_axis = 'xy';266 mouse_helper_delay = TRX_ADDONS_STORAGE['mouse_helper_delay'];267 if ( _window_width >= TRX_ADDONS_STORAGE['mobile_breakpoint_mousehelper_off'] ) {268 mouse_helper_timeout = setTimeout( function() {269 mouse_helper_reset();270 }, 300 );271 }272 if ( e.relatedTarget ) {273 var newTarget = jQuery(e.relatedTarget);274 if ( ! newTarget.data('mouse-helper') ) {275 newTarget = newTarget.parents('[data-mouse-helper]').eq(0);276 }277 if ( newTarget.length > 0 && newTarget.data('mouse-helper') ) {278 setTimeout( function() {279 newTarget.trigger('mouseenter');280 }, 0 );281 }282 }283 } )284 .on("mousedown", '[data-mouse-helper]', function(e) {285 var $self = jQuery(this);286 $mouse_helper.addClass('trx_addons_mouse_helper_click');287 mouse_helper_callback = $self.data( 'mouse-helper-callback' );288 if ( mouse_helper_callback === undefined ) {289 mouse_helper_callback = '';290 }291 if ( mouse_helper_callback && typeof window[mouse_helper_callback] == 'function' ) {292 window[mouse_helper_callback]( 'mousedown', $mouse_helper, $self, e );293 } else if ( typeof window['trx_addons_mouse_helper_callback_' + mouse_helper_action] == 'function' ) {294 window['trx_addons_mouse_helper_callback_' + mouse_helper_action]( 'mousedown', $mouse_helper, $self, e );295 }296 } )297 .on("mouseup", '[data-mouse-helper]', function(e) {298 var $self = jQuery(this);299 $mouse_helper.removeClass('trx_addons_mouse_helper_click');300 mouse_helper_callback = $self.data( 'mouse-helper-callback' );301 if ( mouse_helper_callback === undefined ) {302 mouse_helper_callback = '';303 }304 if ( mouse_helper_callback && typeof window[mouse_helper_callback] == 'function' ) {305 window[mouse_helper_callback]( 'mouseup', $mouse_helper, $self, e );306 } else if ( typeof window['trx_addons_mouse_helper_callback_' + mouse_helper_action] == 'function' ) {307 window['trx_addons_mouse_helper_callback_' + mouse_helper_action]( 'mouseup', $mouse_helper, $self, e );308 }309 } );310 var mouse_helper_reset = function() {311 $mouse_helper312 .find('.trx_addons_mouse_helper_image,.trx_addons_mouse_helper_text,.trx_addons_mouse_helper_icon,.trx_addons_mouse_helper_layout')313 .addClass('trx_addons_mouse_helper_reset_item')314 .fadeOut('slow', function() {315 var $self = jQuery(this);316 if ( $self.hasClass('trx_addons_mouse_helper_reset_item') ) {317 $self.remove();318 }319 });320 $mouse_helper321 .css( {322 'mix-blend-mode': mouse_helper_blend_mode,323 'color': mouse_helper_color,324 'background-color': mouse_helper_bg_color,325 'border-color': mouse_helper_bd_color326 } )327 .removeClass(328 "trx_addons_mouse_helper_active"329 + " trx_addons_mouse_helper_with_icon"330 + " trx_addons_mouse_helper_with_text"331 + " trx_addons_mouse_helper_text_round"332 + " trx_addons_mouse_helper_with_image"333 + " trx_addons_mouse_helper_with_layout"334 + ( TRX_ADDONS_STORAGE['mouse_helper_centered'] > 0 ? "" : " trx_addons_mouse_helper_centered" )335 );336 if ( mouse_helper_callback && typeof window[mouse_helper_callback] == 'function' ) {337 window[mouse_helper_callback]( 'reset', $mouse_helper, mouse_helper_last_target, null );338 mouse_helper_callback = '';339 } else if ( typeof window['trx_addons_mouse_helper_callback_' + mouse_helper_last_action] == 'function' ) {340 window['trx_addons_mouse_helper_callback_' + mouse_helper_last_action]( 'reset', $mouse_helper, mouse_helper_last_target, e );341 }342 };343 var mouse_helper_move = function() {344 cancelAnimationFrame(mouse_helper_move);345 if ( _window_width >= TRX_ADDONS_STORAGE['mobile_breakpoint_mousehelper_off'] && null !== mouseX && ( destX != mouseX || destY != mouseY ) && mouse_helper_delay > 1 ) {346 if ( $mouse_helper.hasClass( 'trx_addons_mouse_helper_permanent' ) || $mouse_helper.hasClass( 'trx_addons_mouse_helper_active' ) ) {347 destX += (mouseX - destX) / mouse_helper_delay;348 destY += (mouseY - destY) / mouse_helper_delay;349 } else {350 destX = mouseX;351 destY = mouseY;352 }353 $mouse_helper.css("transform", "translate(" + destX + "px," + destY + "px)");354 }355 requestAnimationFrame(mouse_helper_move);356 };357 requestAnimationFrame(mouse_helper_move);358 // Get current state359 function trx_addons_mouse_helper_get_state(e) {360 if ( e.clientX === undefined ) return;361 realX = e.clientX + _window_scroll_left;362 realY = e.clientY + _window_scroll_top;363 if ( mouse_helper_axis.indexOf('x') != -1 ) mouseX = e.clientX;364 if ( mouse_helper_axis.indexOf('y') != -1 ) mouseY = e.clientY;365 }366 // Check magnets367 function trx_addons_mouse_helper_check_magnets() {368 $mouse_helper_magnets.each( function() {369 var item = jQuery(this),370 inner = item.children(),371 koef = item.data('mouse-helper-magnet-velocity') ? item.data('mouse-helper-magnet-velocity') : 1,372 delta = item.data('mouse-helper-magnet') * koef;373 var data, cx, cy, iw, ih, ix, iy, near; //position variables374 requestAnimationFrame(control_item);375 function control_item() {376 var off = item.offset();377 cx = realX;378 cy = realY;379 iw = item.width();380 ih = item.height();381 ix = off.left + iw / 2;382 iy = off.top + ih / 2;383 near = Math.abs(ix - cx) < iw * koef && Math.abs(iy - cy) < ih * koef;384 if (near) {385 ! item.hasClass('trx_addons_mouse_helper_near') && move_item();386 requestAnimationFrame(control_item);387 } else {388 item.hasClass('trx_addons_mouse_helper_near') && reset_item();389 }390 }391 function move_item() {392 item.addClass('trx_addons_mouse_helper_near');393 var d = get_closest_position(),394 dx = d.x,395 dy = d.y,396 nx = 0,397 ny = 0;398 transform_item();399 function transform_item() {400 var d = get_closest_position();401 nx += (d.x - dx) / 5;402 ny += (d.y - dy) / 5;403 nx.toFixed(2) !== dx.toFixed(2) &&404 inner.css({405 'transition': 'none',406 'transform': 'translate3d(' + nx + 'px, ' + ny + 'px, 0)'407 });408 dx = nx;409 dy = ny;410 requestAnimationFrame(function () {411 near && transform_item();412 });413 }414 function get_closest_position() {415 return {416 x: Math.abs(cx - ix) < delta ? cx - ix : delta * (cx - ix) / Math.abs(cx - ix),417 y: Math.abs(cy - iy) < delta ? cy - iy : delta * (cy - iy) / Math.abs(cy - iy)418 };419 }420 }421 function reset_item() {422 item.removeClass('trx_addons_mouse_helper_near');423 inner424 .css({425 'transition': 'transform 0.5s',426 'transform': 'translate3d(0px, 0px, 0px)'427 })428 .one( typeof window.trx_addons_transition_end != 'undefined' ? trx_addons_transition_end() : 'transitionend', function () {429 inner.css({430 'transition': 'none'431 });432 });433 }434 } );435 }436 }437 } );438 // Add Mouse helper to the TOC menu439 $document.on( 'action.build_page_toc', function() {440 jQuery( '#toc_menu .toc_menu_item' ).each( function() {441 if ( TRX_ADDONS_STORAGE['mouse_helper'] > 0 ) {442 var $self = jQuery(this),443 title = $self.attr( 'title' ) || $self.find('.toc_menu_description_title').text();444 $self.attr( {445 'data-mouse-helper': 'hover',446 'data-mouse-helper-axis': 'y',447 'data-mouse-helper-text': TRX_ADDONS_STORAGE['msg_mouse_helper_anchor'] + ( title ? ' ' + title : '' )448 } );449 }450 } );451 } );...

Full Screen

Full Screen

op-restricted-names.js

Source:op-restricted-names.js Github

copy

Full Screen

1var testCases = [2 {3 name: 'RestrictedNames',4 precondition: [5 {fullPath:'/a', isDirectory:true},6 {fullPath:'/b', isDirectory:true},7 {fullPath:'/c', isDirectory:true}8 ],9 tests: [10 function(helper) { helper.getFile('/', '.', {create:true}, FileError.SECURITY_ERR); },11 function(helper) { helper.getFile('/', '..', {create:true}, FileError.SECURITY_ERR); },12 function(helper) { helper.getFile('/', 'con', {create:true}, 0); },13 function(helper) { helper.getFile('/', 'CON', {create:true}, 0); },14 function(helper) { helper.getFile('/', 'Con', {create:true}, 0); },15 function(helper) { helper.getFile('/', 'cOn.txt', {create:true}, 0); },16 function(helper) { helper.getFile('/', 'a/coN', {create:true}, 0); },17 function(helper) { helper.getFile('/', 'prn', {create:true}, 0); },18 function(helper) { helper.getFile('/', 'PRN', {create:true}, 0); },19 function(helper) { helper.getFile('/', 'Prn', {create:true}, 0); },20 function(helper) { helper.getFile('/', 'pRn.txt', {create:true}, 0); },21 function(helper) { helper.getFile('/', 'a/prN', {create:true}, 0); },22 function(helper) { helper.getFile('/', 'aux', {create:true}, 0); },23 function(helper) { helper.getFile('/', 'AUX', {create:true}, 0); },24 function(helper) { helper.getFile('/', 'Aux', {create:true}, 0); },25 function(helper) { helper.getFile('/', 'aUx.txt', {create:true}, 0); },26 function(helper) { helper.getFile('/', 'a/auX', {create:true}, 0); },27 function(helper) { helper.getFile('/', 'nul', {create:true}, 0); },28 function(helper) { helper.getFile('/', 'NUL', {create:true}, 0); },29 function(helper) { helper.getFile('/', 'Nul', {create:true}, 0); },30 function(helper) { helper.getFile('/', 'nUl.txt', {create:true}, 0); },31 function(helper) { helper.getFile('/', 'a/nuL', {create:true}, 0); },32 function(helper) { helper.getFile('/', 'com1', {create:true}, 0); },33 function(helper) { helper.getFile('/', 'COM2', {create:true}, 0); },34 function(helper) { helper.getFile('/', 'Com4', {create:true}, 0); },35 function(helper) { helper.getFile('/', 'cOM7.foo', {create:true}, 0); },36 function(helper) { helper.getFile('/', 'a/coM9', {create:true}, 0); },37 function(helper) { helper.getFile('/', 'lpt1', {create:true}, 0); },38 function(helper) { helper.getFile('/', 'LPT2', {create:true}, 0); },39 function(helper) { helper.getFile('/', 'Lpt4', {create:true}, 0); },40 function(helper) { helper.getFile('/', 'lPT7.foo', {create:true}, 0); },41 function(helper) { helper.getFile('/', 'a/lpT9', {create:true}, 0); },42 function(helper) { helper.getFile('/', 'foo ', {create:true}, 0); },43 function(helper) { helper.getFile('/', 'foo\n', {create:true}, 0); },44 function(helper) { helper.getFile('/', 'foo.', {create:true}, 0); },45 function(helper) { helper.copy('/a', '/', 'foo ', 0); },46 function(helper) { helper.copy('/a', '/', 'foo\t', 0); },47 function(helper) { helper.copy('/a', '/', 'foo..', 0); },48 function(helper) { helper.move('/a', '/', 'foo ', 0); },49 function(helper) { helper.move('/b', '/', 'foo\t\t', 0); },50 function(helper) { helper.move('/c', '/', 'foo.....', 0); },51 ],52 postcondition: [53 {fullPath:'/foo ', isDirectory:true},54 {fullPath:'/foo\t\t', isDirectory:true},55 {fullPath:'/foo.....', isDirectory:true}56 ],57 },...

Full Screen

Full Screen

op-restricted-unicode.js

Source:op-restricted-unicode.js Github

copy

Full Screen

1var testCases = [2 {3 name: 'RestrictedUnicodeChars',4 precondition: [ ],5 tests: [6 function(helper) { helper.getFile('/', 'ab', {create:true}); },7 // Embedded NULs aren't allowed; anything else in the first 32 is fair game.8 function(helper) { helper.getFile('/', 'a\u0000b', {create:true}, FileError.INVALID_MODIFICATION_ERR); },9 function(helper) { helper.getFile('/', 'a\u0001b', {create:true}, 0); },10 function(helper) { helper.getFile('/', 'a\u0002b', {create:true}, 0); },11 function(helper) { helper.getFile('/', 'a\u0003b', {create:true}, 0); },12 function(helper) { helper.getFile('/', 'a\u0004b', {create:true}, 0); },13 function(helper) { helper.getFile('/', 'a\u0005b', {create:true}, 0); },14 function(helper) { helper.getFile('/', 'a\u0006b', {create:true}, 0); },15 function(helper) { helper.getFile('/', 'a\u0007b', {create:true}, 0); },16 function(helper) { helper.getFile('/', 'a\u0008b', {create:true}, 0); },17 function(helper) { helper.getFile('/', 'a\u0009b', {create:true}, 0); },18 function(helper) { helper.getFile('/', 'a\u000ab', {create:true}, 0); },19 function(helper) { helper.getFile('/', 'a\u000bb', {create:true}, 0); },20 function(helper) { helper.getFile('/', 'a\u000cb', {create:true}, 0); },21 function(helper) { helper.getFile('/', 'a\u000db', {create:true}, 0); },22 function(helper) { helper.getFile('/', 'a\u000eb', {create:true}, 0); },23 function(helper) { helper.getFile('/', 'a\u000fb', {create:true}, 0); },24 function(helper) { helper.getFile('/', 'a\u0010b', {create:true}, 0); },25 function(helper) { helper.getFile('/', 'a\u0011b', {create:true}, 0); },26 function(helper) { helper.getFile('/', 'a\u0012b', {create:true}, 0); },27 function(helper) { helper.getFile('/', 'a\u0013b', {create:true}, 0); },28 function(helper) { helper.getFile('/', 'a\u0014b', {create:true}, 0); },29 function(helper) { helper.getFile('/', 'a\u0015b', {create:true}, 0); },30 function(helper) { helper.getFile('/', 'a\u0016b', {create:true}, 0); },31 function(helper) { helper.getFile('/', 'a\u0017b', {create:true}, 0); },32 function(helper) { helper.getFile('/', 'a\u0018b', {create:true}, 0); },33 function(helper) { helper.getFile('/', 'a\u0019b', {create:true}, 0); },34 function(helper) { helper.getFile('/', 'a\u001ab', {create:true}, 0); },35 function(helper) { helper.getFile('/', 'a\u001bb', {create:true}, 0); },36 function(helper) { helper.getFile('/', 'a\u001cb', {create:true}, 0); },37 function(helper) { helper.getFile('/', 'a\u001db', {create:true}, 0); },38 function(helper) { helper.getFile('/', 'a\u001eb', {create:true}, 0); }39 ],40 postcondition: [41 {fullPath:'/ab'},42 ],43 },...

Full Screen

Full Screen

wscript

Source:wscript Github

copy

Full Screen

1## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-2def build(bld):3 obj = bld.create_ns3_module('energy', ['network'])4 obj.source = [5 'model/energy-source.cc',6 'model/basic-energy-source.cc',7 'model/li-ion-energy-source.cc',8 'model/rv-battery-model.cc',9 'model/device-energy-model.cc',10 'model/device-energy-model-container.cc',11 'model/simple-device-energy-model.cc',12 'model/energy-harvester.cc',13 'model/basic-energy-harvester.cc',14 'helper/energy-source-container.cc',15 'helper/energy-model-helper.cc',16 'helper/basic-energy-source-helper.cc',17 'helper/li-ion-energy-source-helper.cc',18 'helper/rv-battery-model-helper.cc',19 'helper/energy-harvester-container.cc',20 'helper/energy-harvester-helper.cc',21 'helper/basic-energy-harvester-helper.cc',22 ]23 obj_test = bld.create_ns3_module_test_library('energy')24 obj_test.source = [25 'test/li-ion-energy-source-test.cc',26 'test/basic-energy-harvester-test.cc',27 ]28 headers = bld(features='ns3header')29 headers.module = 'energy'30 headers.source = [31 'model/energy-source.h',32 'model/basic-energy-source.h',33 'model/li-ion-energy-source.h',34 'model/rv-battery-model.h',35 'model/device-energy-model.h',36 'model/device-energy-model-container.h',37 'model/simple-device-energy-model.h',38 'model/energy-harvester.h',39 'model/basic-energy-harvester.h',40 'helper/energy-source-container.h',41 'helper/energy-model-helper.h',42 'helper/basic-energy-source-helper.h',43 'helper/li-ion-energy-source-helper.h',44 'helper/rv-battery-model-helper.h',45 'helper/energy-harvester-container.h',46 'helper/energy-harvester-helper.h',47 'helper/basic-energy-harvester-helper.h',48 ]49 if (bld.env['ENABLE_EXAMPLES']):50 bld.recurse('examples')...

Full Screen

Full Screen

__init__.py

Source:__init__.py Github

copy

Full Screen

1from cupy.testing import array2from cupy.testing import attr3from cupy.testing import helper4from cupy.testing import parameterized5assert_allclose = array.assert_allclose6assert_array_almost_equal = array.assert_array_almost_equal7assert_array_almost_equal_nulp = array.assert_array_almost_equal_nulp8assert_array_max_ulp = array.assert_array_max_ulp9assert_array_equal = array.assert_array_equal10assert_array_list_equal = array.assert_array_list_equal11assert_array_less = array.assert_array_less12numpy_cupy_allclose = helper.numpy_cupy_allclose13numpy_cupy_array_almost_equal = helper.numpy_cupy_array_almost_equal14numpy_cupy_array_almost_equal_nulp = \15 helper.numpy_cupy_array_almost_equal_nulp16numpy_cupy_array_max_ulp = helper.numpy_cupy_array_max_ulp17numpy_cupy_array_equal = helper.numpy_cupy_array_equal18numpy_cupy_array_list_equal = helper.numpy_cupy_array_list_equal19numpy_cupy_array_less = helper.numpy_cupy_array_less20numpy_cupy_raises = helper.numpy_cupy_raises21for_dtypes = helper.for_dtypes22for_all_dtypes = helper.for_all_dtypes23for_float_dtypes = helper.for_float_dtypes24for_signed_dtypes = helper.for_signed_dtypes25for_unsigned_dtypes = helper.for_unsigned_dtypes26for_int_dtypes = helper.for_int_dtypes27for_dtypes_combination = helper.for_dtypes_combination28for_all_dtypes_combination = helper.for_all_dtypes_combination29for_signed_dtypes_combination = helper.for_signed_dtypes_combination30for_unsigned_dtypes_combination = helper.for_unsigned_dtypes_combination31for_int_dtypes_combination = helper.for_int_dtypes_combination32for_orders = helper.for_orders33for_CF_orders = helper.for_CF_orders34with_requires = helper.with_requires35parameterize = parameterized.parameterize36product = parameterized.product37shaped_arange = helper.shaped_arange38shaped_reverse_arange = helper.shaped_reverse_arange39shaped_random = helper.shaped_random40NumpyError = helper.NumpyError41gpu = attr.gpu...

Full Screen

Full Screen

duration_widget_tests.py

Source:duration_widget_tests.py Github

copy

Full Screen

1from rdrf.forms.widgets.widgets import DurationWidgetHelper2def test_duration_compatibile_formats():3 helper = DurationWidgetHelper({})4 assert helper.compatible_formats("P0Y0M0D", "P0Y")5 assert helper.compatible_formats("P0Y0M0D", "P0Y0D")6 assert helper.compatible_formats("P0Y0M0D", "P0M0D")7 assert helper.compatible_formats("P0Y0M0DT0H0M0S", "PT0S")8 assert helper.compatible_formats("P0M0D", "P0D")9def test_duration_incompatible_formats():10 helper = DurationWidgetHelper({})11 assert not helper.compatible_formats("P0Y0M0D", "P0Y0M0DT0H0M0S")12 assert not helper.compatible_formats("P0Y0M0D", "P0Y0M0DT0M")13 assert not helper.compatible_formats("P0Y0M0D", "PT0M0H0S")14 assert not helper.compatible_formats("P0Y0M0DT0H0M", "PT0S")15 assert not helper.compatible_formats("P0M0D", "P0Y0D")16 assert not helper.compatible_formats("P0M0D", "PXTR")17 assert not helper.compatible_formats("ABCD", "XYZ")18def test_current_default_format():19 helper = DurationWidgetHelper({20 "years": True, "months": False, "days": True,21 "hours": False, "minutes": False, "seconds": False22 })23 assert helper.current_format_default() == "P0Y0D"24 helper = DurationWidgetHelper({25 "weeks_only": True26 })27 assert helper.current_format_default() == "P0W"28 helper = DurationWidgetHelper({29 "years": False, "months": False, "days": True,30 "hours": True, "minutes": True, "seconds": False31 })...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const { helperMethod } = require("fast-check-monorepo");2helperMethod();3const { helperMethod } = require("fast-check-monorepo");4helperMethod();5const { helperMethod } = require("fast-check-monorepo");6helperMethod();7const { helperMethod } = require("fast-check-monorepo");8helperMethod();9const { helperMethod } = require("fast-check-monorepo");10helperMethod();11const { helperMethod } = require("fast-check-monorepo");12helperMethod();13const { helperMethod } = require("fast-check-monorepo");14helperMethod();15const { helperMethod } = require("fast-check-monorepo");16helperMethod();17const { helperMethod } = require("fast-check-monorepo");18helperMethod();19const { helperMethod } = require("fast-check-monorepo");20helperMethod();21const { helperMethod } = require("fast-check-monorepo");22helperMethod();23const { helperMethod } = require("fast-check-monorepo");24helperMethod();25const { helperMethod } = require("fast-check-monorepo");26helperMethod();27const { helperMethod } = require("fast-check-monorepo");28helperMethod();

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require('fast-check');2const { myHelperMethod } = require('fast-check-monorepo');3fc.assert(4 fc.property(fc.integer(), fc.integer(), (a, b) => {5 return myHelperMethod(a, b) === a + b;6 })7);8 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)9 at Function.Module._load (internal/modules/cjs/loader.js:725:27)10 at Module.require (internal/modules/cjs/loader.js:952:19)11 at require (internal/modules/cjs/helpers.js:88:18)12 at Object.<anonymous> (/Users/xxx/Desktop/test3.js:2:16)13 at Module._compile (internal/modules/cjs/loader.js:1063:30)14 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)15 at Module.load (internal/modules/cjs/loader.js:928:32)16 at Function.Module._load (internal/modules/cjs/loader.js:769:14)17 at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {18}19const fc = require('fast-check');20const { myHelperMethod } = require('fast-check-monorepo');21fc.assert(22 fc.property(fc.integer(), fc.integer(), (a

Full Screen

Using AI Code Generation

copy

Full Screen

1const { helper } = require('fast-check-monorepo');2const { helper2 } = require('fast-check-monorepo-2');3const { helper3 } = require('fast-check-monorepo-3');4const { helper4 } = require('fast-check-monorepo-4');5const { helper5 } = require('fast-check-monorepo-5');6const { helper6 } = require('fast-check-monorepo-6');7const { helper7 } = require('fast-check-monorepo-7');8const { helper8 } = require('fast-check-monorepo-8');9const { helper9 } = require('fast-check-monorepo-9');10const { helper10 } = require('fast-check-monorepo-10');11const { helper11 } = require('fast-check-monorepo-11');12const { helper12 } = require('fast-check-monorepo-12');13const { helper13 } = require('fast-check-monorepo-13');14const { helper14 } = require('fast-check-monorepo-14');15const { helper15 } = require('fast-check-monorepo-15');16const { helper16 } = require('fast-check-monorepo-16');17const { helper17 }

Full Screen

Using AI Code Generation

copy

Full Screen

1const { helper } = require("fast-check-monorepo");2const { helper } = require("fast-check-monorepo");3const { helper } = require("fast-check-monorepo");4const { helper } = require("fast-check-monorepo");5const { helper } = require("fast-check-monorepo");6const { helper } = require("fast-check-monorepo");7const { helper } = require("fast-check-monorepo");8const { helper } = require("fast-check-monorepo");9const { helper } = require("fast-check-monorepo");10const { helper } = require("fast-check-monorepo");11const { helper } = require("fast-check-monorepo");12const { helper } = require("fast-check-monorepo");13const { helper } = require("fast-check-monorepo");14const { helper } = require("fast-check-monorepo");15const { helper } = require("fast-check-monorepo");16const { helper } = require("fast-check-mon

Full Screen

Using AI Code Generation

copy

Full Screen

1const { helperMethod } = require('fast-check-monorepo-helper');2const { helperMethod2 } = require('fast-check-monorepo-helper2');3module.exports = {4};5const { helperMethod } = require('fast-check-monorepo-helper');6const { helperMethod2 } = require('fast-check-monorepo-helper2');7module.exports = {8};9const { helperMethod } = require('fast-check-monorepo-helper');10const { helperMethod2 } = require('fast-check-monorepo-helper2');11module.exports = {12};13const { helperMethod } = require('fast-check-monorepo-helper');14const { helperMethod2 } = require('fast-check-monorepo-helper2');15module.exports = {16};17const { helperMethod } = require('fast-check-monorepo-helper');18const { helperMethod2 } = require('fast-check-monorepo-helper2');19module.exports = {20};21const { helperMethod } = require('fast-check-monorepo-helper');22const { helperMethod2 } = require('fast-check-monorepo-helper2');23module.exports = {24};25const { helperMethod } = require('fast-check-monorepo-helper');26const { helperMethod2 } = require('fast-check-monorepo-helper2');27module.exports = {28};29const { helperMethod } = require('fast-check-monorepo-helper');30const { helperMethod2 } = require('fast-check-monore

Full Screen

Using AI Code Generation

copy

Full Screen

1const fc = require("fast-check");2const { helpers } = require("fast-check-monorepo");3const { isPrime } = helpers;4fc.assert(5 fc.property(fc.integer(), (n) => {6 return isPrime(n);7 })8);9const fc = require("fast-check");10const { helpers } = require("fast-check-monorepo");11const { isPrime } = helpers;12fc.assert(13 fc.property(fc.integer(), (n) => {14 return isPrime(n);15 })16);17const fc = require("fast-check");18const { helpers } = require("fast-check-monorepo");19const { isPrime } = helpers;20fc.assert(21 fc.property(fc.integer(), (n) => {22 return isPrime(n);23 })24);25const fc = require("fast-check");26const { helpers } = require("fast-check-monorepo");27const { isPrime } = helpers;28fc.assert(29 fc.property(fc.integer(), (n) => {30 return isPrime(n);31 })32);33const fc = require("fast-check");34const { helpers } = require("fast-check-monorepo");35const { isPrime } = helpers;36fc.assert(37 fc.property(fc.integer(), (n) => {38 return isPrime(n);39 })40);41const fc = require("fast-check");42const { helpers } = require("fast-check-monorepo");43const { isPrime } = helpers;44fc.assert(45 fc.property(fc.integer(), (n) => {46 return isPrime(n);47 })48);49const fc = require("fast-check");50const { helpers } = require("fast-check-monorepo");51const { isPrime } = helpers;52fc.assert(53 fc.property(fc.integer(), (n) => {54 return isPrime(n);55 })56);

Full Screen

Using AI Code Generation

copy

Full Screen

1const { makeTest } = require('fast-check-monorepo-test');2const test = makeTest('test3');3test('test3', t => {4 t.pass();5});6const { makeTest } = require('fast-check-monorepo-test');7const test = makeTest('test4');8test('test4', t => {9 t.pass();10});11const { makeTest } = require('fast-check-monorepo-test');12const test = makeTest('test5');13test('test5', t => {14 t.pass();15});16const { makeTest } = require('fast-check-monorepo-test');17const test = makeTest('test6');18test('test6', t => {19 t.pass();20});21const { makeTest } = require('fast-check-monorepo-test');22const test = makeTest('test7');23test('test7', t => {24 t.pass();25});26const { makeTest } = require('fast-check-monorepo-test');27const test = makeTest('test8');28test('test8', t => {29 t.pass();30});31const { makeTest } = require('fast-check-monorepo-test');32const test = makeTest('test9');33test('test9', t => {34 t.pass();35});36const { makeTest } = require('fast-check-monorepo-test');37const test = makeTest('test10');38test('test10', t => {39 t.pass();40});41const { makeTest } = require('fast-check-monorepo-test');42const test = makeTest('test11');43test('test11', t => {

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fast-check-monorepo automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful