/* {{{ Core URL Tests */
var core_urls = {
'http://localhost/build/yui-base/yui-base.js': { path: 'http://localhost/build/', filter: undefined },
'http://localhost/build/yui-base/yui-base-debug.js': { path: 'http://localhost/build/', filter: 'debug' },
'http://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base.js': { path: 'http://combohost.com/combo?/build/', filter: undefined },
'http://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base-debug.js': { path: 'http://combohost.com/combo?/build/', filter: 'debug' },
'http://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base.js&build/loader/loader.js': { path: 'http://combohost.com/combo?/build/', filter: undefined },
'http://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base-debug.js&buid/loader/loader.js': { path: 'http://combohost.com/combo?/build/', filter: 'debug' },
'https://localhost/build/yui-base/yui-base.js': { path: 'https://localhost/build/', filter: undefined },
'https://localhost/build/yui-base/yui-base-debug.js': { path: 'https://localhost/build/', filter: 'debug' },
'https://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base.js': { path: 'https://combohost.com/combo?/build/', filter: undefined },
'https://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base-debug.js': { path: 'https://combohost.com/combo?/build/', filter: 'debug' },
'https://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base.js&build/loader/loader.js': { path: 'https://combohost.com/combo?/build/', filter: undefined },
'https://combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base-debug.js&buid/loader/loader.js': { path: 'https://combohost.com/combo?/build/', filter: 'debug' },
'//combohost.com/combo?foo/foo.js&bar-bar.js&/build/simpleyui/simpleyui.js&build/loader/loader.js': { path: '//combohost.com/combo?/build/', filter: undefined },
'//combohost.com/combo?foo/foo.js&bar-bar.js&/build/simpleyui/simpleyui-debug.js&buid/oop/oop.js': { path: '//combohost.com/combo?/build/', filter: 'debug' },
'//combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base.js': { path: '//combohost.com/combo?/build/', filter: undefined },
'//combohost.com/combo?foo/foo.js&bar-bar.js&/build/yui-base/yui-base-debug.js': { path: '//combohost.com/combo?/build/', filter: 'debug' }
};
/* }}} */
name: "Core tests",
_should: {
ignore: {
'getLocation() should return `undefined` when executing in node.js': (!Y.UA.nodejs || (Y.UA.nodejs && Y.config.win)) //If there is a window object, ignore too
}
},
'cached functions should execute only once per input': function() {
var f1 = function(a) {
r1 += a;
};
c1('a');
c1('b');
c1('a');
c1('b');
c1('a');
c1('b');
var f2 = function(a, b) {
r2 += (a + b);
};
var o = new Y.EventTarget();
o.foo = 1;
var f3 = function(a) {
r3 += a;
};
a: 'z'
});
c3('a');
c3('b');
c3('a');
c3('b');
c3('a');
c3('b');
// falsy second arg needs to produce a different key than no second arg
},
'getLocation() should return the location object': function () {
},
'getLocation() should return `undefined` when executing in node.js': function () {
},
test_cached_undefined_null: function() {
var f1 = function(a) {
return a;
};
var a = c1(null);
a = c1('foo');
},
test_ie_enum_bug: function() {
var o = {
valueOf: function() {
return 'foo';
}
},
p = Y.merge(o);
},
test_guid: function() {
for (i = 0; i < 1000; i++) {
}
},
test_stamp: function() {
for (i = 0; i < 1000; i++) {
}
},
test_use_array: function() {
});
},
test_use_strings: function() {
});
},
test_one_submodule: function() {
YUI({
modules:{
'something':{
'submodules':{
'something1':{
}
}
}
}
}).use('something1', function(Y) {
});
},
test_rollup_false: function() {
});
});
},
test_base_path: function() {
for (var i in core_urls) {
//This test is assuming that IE returns an undefined, but it actually returns an empty string for the property
//Assert.areSame(info.filter, core_urls[i].filter, 'Filters do not match (' + core_urls[i].path + ')');
}
},
test_log_params: function() {
return;
}
last;
};
Y.applyConfig({
logInclude: {
logMe: true,
butNotMe: false
}
});
Y.applyConfig({
logInclude: '',
logExclude: {
excludeMe: true,
butDontExcludeMe: false
}
});
});
},
test_global_apply_config: function() {
test = this;
modules: {
davglass: {
fullpath: './assets/davglass.js'
}
}
});
modules: {
foo: {
}
}
});
},
test_old_config: function() {
foo: true
});
},
test_applyTo: function() {
xdrReady: function() {
}
};
};
},
test_global_config: function() {
test = this;
});
});
},
test_multiple_ua: function() {
uaFF = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0) Gecko/20100101 Firefox/6.0',
uaChrome = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.860.0 Safari/535.2';
Assert.areEqual(YUI.Env.UA.userAgent, Y2.UA.userAgent, 'Global UA and local (Y2) UA are different');
},
test_conditional: function() {
test = this;
Y.cond = true;
});
Y.condTest = true;
});
YUI({
modules: {
'cond-test': {
condition: {
trigger: 'cond',
test: function() {
return true;
}
}
}
}
//Should be sync..
});
},
test_missed: function() {
},
test_attach_error: function() {
YUI({
return true;
}
}).use('attach-error');
},
test_attach_after: function() {
Y.afterTest = true;
}, '1.0.0', {
after: [ 'node' ]
});
});
},
test_dump_core: function() {
o = {},
},
test_destroy: function() {
},
test_features: function() {
Assert.areEqual(testY.Object.keys(testY.Features.tests.load).length, results.split(';').length, 'Failed to return all results for Feature Tests');
},
'test: requirements defined in external module': function() {
var test = this,
YUI({
modules: {
mod: {
}
}
}).use('mod', function(Y) {
});
});
}
});
});