pax_global_header00006660000000000000000000000064122633367770014532gustar00rootroot0000000000000052 comment=7ca236b2e5a5c8261d3d7c493781f23a4a11f2e6 almond-0.2.9/000077500000000000000000000000001226333677700130145ustar00rootroot00000000000000almond-0.2.9/.gitignore000066400000000000000000000000121226333677700147750ustar00rootroot00000000000000.DS_Store almond-0.2.9/.npmignore000066400000000000000000000000131226333677700150050ustar00rootroot00000000000000tests *.sh almond-0.2.9/.travis.yml000066400000000000000000000002761226333677700151320ustar00rootroot00000000000000language: node_js node_js: 0.8 before_script: - node tests/server.js & - sleep 1 script: phantomjs tests/runner.js after_script: - kill -9 `cat tests/pid.txt` - rm tests/pid.txt almond-0.2.9/LICENSE000066400000000000000000000054151226333677700140260ustar00rootroot00000000000000almond is released under two licenses: new BSD, and MIT. You may pick the license that best suits your development needs. The text of both licenses are provided below. The "New" BSD License: ---------------------- Copyright (c) 2010-2011, The Dojo Foundation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Dojo Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MIT License ----------- Copyright (c) 2010-2011, The Dojo Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. almond-0.2.9/README.md000066400000000000000000000201241226333677700142720ustar00rootroot00000000000000#almond A replacement [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) loader for [RequireJS](http://requirejs.org). It is a smaller "shim" loader, providing the minimal AMD API footprint that includes [loader plugin](http://requirejs.org/docs/plugins.html) support. ## Why Some developers like to use the AMD API to code modular JavaScript, but after doing an optimized build, they do not want to include a full AMD loader like RequireJS, since they do not need all that functionality. Some use cases, like mobile, are very sensitive to file sizes. By including almond in the built file, there is no need for RequireJS. almond is around **1 kilobyte** when minified with Closure Compiler and gzipped. Since it can support certain types of loader plugin-optimized resources, it is a great fit for a library that wants to use [text templates](http://requirejs.org/docs/api.html#text) or [CoffeeScript](https://github.com/jrburke/require-cs) as part of their project, but get a tiny download in one file after using the [RequireJS Optimizer](http://requirejs.org/docs/optimization.html). If you are building a library, the wrap=true support in the RequireJS optimizer will wrap the optimized file in a closure, so the define/require AMD API does not escape the file. Users of your optimized file will only see the global API you decide to export, not the AMD API. See the usage section below for more details. So, you get great code cleanliness with AMD and the use of powerful loader plugins in a tiny wrapper that makes it easy for others to use your code even if they do not use AMD. ## Restrictions It is best used for libraries or apps that use AMD and: * optimize all the modules into one file -- no dynamic code loading. * all modules have IDs and dependency arrays in their define() calls -- the RequireJS optimizer will take care of this for you. * only have **one** requirejs.config() or require.config() call. * do not use the `var require = {};` style of [passing config](http://requirejs.org/docs/api.html#config). * do not use [RequireJS multiversion support/contexts](http://requirejs.org/docs/api.html#multiversion). * do not use require.toUrl() or require.nameToUrl(). * do not use [packages/packagePaths config](http://requirejs.org/docs/api.html#packages). If you need to use packages that have a main property, [volo](https://github.com/volojs/volo) can create an adapter module so that it can work without this config. Use the `amdify add` command to add the dependency to your project. What is supported: * dependencies with relative IDs. * define('id', {}) definitions. * define(), require() and requirejs() calls. * loader plugins that can inline their resources into optimized files, and can access those inlined resources synchronously after the optimization pass. The [text](http://requirejs.org/docs/api.html#text) and [CoffeeScript](https://github.com/jrburke/require-cs) plugins are two such plugins. ## Download [Latest release](https://github.com/jrburke/almond/raw/latest/almond.js) ## Usage [Download the RequireJS optimizer](http://requirejs.org/docs/download.html#rjs). [Download the current release of almond.js](https://github.com/jrburke/almond/raw/latest/almond.js). Run the optimizer using [Node](http://nodejs.org) (also [works in Java](https://github.com/jrburke/r.js/blob/master/README.md)): node r.js -o baseUrl=. name=path/to/almond include=main out=main-built.js wrap=true This assumes your project's top-level script file is called main.js and the command above is run from the directory containing main.js. If you prefer to use a build.js build profile instead of command line arguments, [this RequireJS optimization section](http://requirejs.org/docs/optimization.html#pitfalls) has info on how to do that. wrap=true will add this wrapper around the main-built.js contents (which will be minified by UglifyJS: (function () { //almond will be here //main and its nested dependencies will be here }()); If you do not want that wrapper, leave off the wrap=true argument. These optimizer arguments can also be used in a build config object, so it can be used in [runtime-generated server builds](https://github.com/jrburke/r.js/blob/master/build/tests/http/httpBuild.js). ## Triggering module execution As of RequireJS 2.0 and almond 0.1, modules are only executed if they are called by a top level require call. The data-main attribute on a script tag for require.js counts as a top level require call. However with almond, it does not look for a data-main attribute, and if your main JS module does not use a top level require() or requirejs() call to trigger module loading/execution, after a build, it may appear that the code broke -- no modules execute. The 2.0 RequireJS optimizer has a build config, option **insertRequire** that you can use to specify that a require([]) call is inserted at the end of the built file to trigger module loading. Example: node r.js -o baseUrl=. name=path/to/almond.js include=main insertRequire=main out=main-built.js wrap=true or, if using a build config file: ```javascript { baseUrl: '.', name: 'path/to/almond', include: ['main'], insertRequire: ['main'], out: 'main-built.js', wrap: true } ``` This will result with `require(["main"]);` at the bottom of main-built.js. ## Exporting a public API If you are making a library that is made up of AMD modules in source form, but will be built with almond into one file, and you want to export a small public API for that library, you can use the `wrap` build config to do so. Build config: ```javascript { baseUrl: '.', name: 'path/to/almond', include: ['main'], out: 'lib-built.js', wrap: { startFile: 'path/to/start.frag', endFile: 'path/to/end.frag' } } ``` Where start.frag could look like this: ```javascript (function (root, factory) { if (typeof define === 'function' && define.amd) { //Allow using this built library as an AMD module //in another project. That other project will only //see this AMD call, not the internal modules in //the closure below. define(factory); } else { //Browser globals case. Just assign the //result to a property on the global. root.libGlobalName = factory(); } }(this, function () { //almond, and your modules will be inlined here ``` and end.frag is like this: ```javascript //The modules for your project will be inlined above //this snippet. Ask almond to synchronously require the //module value for 'main' here and return it as the //value to use for the public API for the built file. return require('main'); })); ``` After the build, then the built file should be structured like so: * start.frag * almond.js * modules for your lib, including 'main' * end.frag ## Common errors Explanations of common errors: ### deps is undefined Where this line is mentioned: if (!deps.splice) { It usually means that there is a define()'d module, but it is missing a name, something that looks like this: define(function () {}); when it should look like: define('someName', function () {}); This is usually a sign that the tool you used to combine all the modules together did not properly name an anonymous AMD module. ### x missing y It means that module 'x' asked for module 'y', but module 'y' was not available. This usually means that 'y' was not included in the built file that includes almond. almond can only handle modules built in with it, it cannot dynamically load modules from the network. ### No y It means that a `require('y')` call was done but y was not available. This usually means that 'y' was not included in the built file that includes almond. almond can only handle modules built in with it, it cannot dynamically load modules from the network. ## How to get help * Contact the [requirejs list](https://groups.google.com/group/requirejs). * Open issues in the [issue tracker](https://github.com/jrburke/almond/issues). ## Contributing Almond follows the [same contribution model as requirejs](http://requirejs.org/docs/contributing.html) and is considered a sub-project of requirejs.almond-0.2.9/almond.js000066400000000000000000000346431226333677700146360ustar00rootroot00000000000000/** * @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ //Going sloppy to avoid 'use strict' string cost, but strict practices should //be followed. /*jslint sloppy: true */ /*global setTimeout: false */ var requirejs, require, define; (function (undef) { var main, req, makeMap, handlers, defined = {}, waiting = {}, config = {}, defining = {}, hasOwn = Object.prototype.hasOwnProperty, aps = [].slice, jsSuffixRegExp = /\.js$/; function hasProp(obj, prop) { return hasOwn.call(obj, prop); } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @returns {String} normalized name */ function normalize(name, baseName) { var nameParts, nameSegment, mapValue, foundMap, lastIndex, foundI, foundStarMap, starI, i, j, part, baseParts = baseName && baseName.split("/"), map = config.map, starMap = (map && map['*']) || {}; //Adjust any relative paths. if (name && name.charAt(0) === ".") { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { //Convert baseName to array, and lop off the last part, //so that . matches that "directory" and not name of the baseName's //module. For instance, baseName of "one/two/three", maps to //"one/two/three.js", but we want the directory, "one/two" for //this normalization. baseParts = baseParts.slice(0, baseParts.length - 1); name = name.split('/'); lastIndex = name.length - 1; // Node .js allowance: if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); } name = baseParts.concat(name); //start trimDots for (i = 0; i < name.length; i += 1) { part = name[i]; if (part === ".") { name.splice(i, 1); i -= 1; } else if (part === "..") { if (i === 1 && (name[2] === '..' || name[0] === '..')) { //End of the line. Keep at least one non-dot //path segment at the front so it can be mapped //correctly to disk. Otherwise, there is likely //no path mapping for a path starting with '..'. //This can still fail, but catches the most reasonable //uses of .. break; } else if (i > 0) { name.splice(i - 1, 2); i -= 2; } } } //end trimDots name = name.join("/"); } else if (name.indexOf('./') === 0) { // No baseName, so this is ID is resolved relative // to baseUrl, pull off the leading dot. name = name.substring(2); } } //Apply map config if available. if ((baseParts || starMap) && map) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join("/"); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && starMap[nameSegment]) { foundStarMap = starMap[nameSegment]; starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function makeRequire(relName, forceSync) { return function () { //A version of a require function that passes a moduleName //value for items that may need to //look up paths relative to the moduleName return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync])); }; } function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(depName) { return function (value) { defined[depName] = value; }; } function callDep(name) { if (hasProp(waiting, name)) { var args = waiting[name]; delete waiting[name]; defining[name] = true; main.apply(undef, args); } if (!hasProp(defined, name) && !hasProp(defining, name)) { throw new Error('No ' + name); } return defined[name]; } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } /** * Makes a name map, normalizing the name, and using a plugin * for normalization if necessary. Grabs a ref to plugin * too, as an optimization. */ makeMap = function (name, relName) { var plugin, parts = splitPrefix(name), prefix = parts[0]; name = parts[1]; if (prefix) { prefix = normalize(prefix, relName); plugin = callDep(prefix); } //Normalize according if (prefix) { if (plugin && plugin.normalize) { name = plugin.normalize(name, makeNormalize(relName)); } else { name = normalize(name, relName); } } else { name = normalize(name, relName); parts = splitPrefix(name); prefix = parts[0]; name = parts[1]; if (prefix) { plugin = callDep(prefix); } } //Using ridiculous property names for space reasons return { f: prefix ? prefix + '!' + name : name, //fullName n: name, pr: prefix, p: plugin }; }; function makeConfig(name) { return function () { return (config && config.config && config.config[name]) || {}; }; } handlers = { require: function (name) { return makeRequire(name); }, exports: function (name) { var e = defined[name]; if (typeof e !== 'undefined') { return e; } else { return (defined[name] = {}); } }, module: function (name) { return { id: name, uri: '', exports: defined[name], config: makeConfig(name) }; } }; main = function (name, deps, callback, relName) { var cjsModule, depName, ret, map, i, args = [], callbackType = typeof callback, usingExports; //Use name if no relName relName = relName || name; //Call the callback to define the module, if necessary. if (callbackType === 'undefined' || callbackType === 'function') { //Pull out the defined dependencies and pass the ordered //values to the callback. //Default to [require, exports, module] if no deps deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; for (i = 0; i < deps.length; i += 1) { map = makeMap(deps[i], relName); depName = map.f; //Fast path CommonJS standard dependencies. if (depName === "require") { args[i] = handlers.require(name); } else if (depName === "exports") { //CommonJS module spec 1.1 args[i] = handlers.exports(name); usingExports = true; } else if (depName === "module") { //CommonJS module spec 1.1 cjsModule = args[i] = handlers.module(name); } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) { args[i] = callDep(depName); } else if (map.p) { map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); args[i] = defined[depName]; } else { throw new Error(name + ' missing ' + depName); } } ret = callback ? callback.apply(defined[name], args) : undefined; if (name) { //If setting exports via "module" is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) { defined[name] = cjsModule.exports; } else if (ret !== undef || !usingExports) { //Use the return value from the function. defined[name] = ret; } } } else if (name) { //May just be an object definition for the module. Only //worry about defining if have a module name. defined[name] = callback; } }; requirejs = require = req = function (deps, callback, relName, forceSync, alt) { if (typeof deps === "string") { if (handlers[deps]) { //callback in this case is really relName return handlers[deps](callback); } //Just return the module wanted. In this scenario, the //deps arg is the module name, and second arg (if passed) //is just the relName. //Normalize module name, if it contains . or .. return callDep(makeMap(deps, callback).f); } else if (!deps.splice) { //deps is a config object, not an array. config = deps; if (config.deps) { req(config.deps, config.callback); } if (!callback) { return; } if (callback.splice) { //callback is an array, which means it is a dependency list. //Adjust args if there are dependencies deps = callback; callback = relName; relName = null; } else { deps = undef; } } //Support require(['a']) callback = callback || function () {}; //If relName is a function, it is an errback handler, //so remove it. if (typeof relName === 'function') { relName = forceSync; forceSync = alt; } //Simulate async callback; if (forceSync) { main(undef, deps, callback, relName); } else { //Using a non-zero value because of concern for what old browsers //do, and latest browsers "upgrade" to 4 if lower value is used: //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: //If want a value immediately, use require('id') instead -- something //that works in almond on the global level, but not guaranteed and //unlikely to work in other AMD implementations. setTimeout(function () { main(undef, deps, callback, relName); }, 4); } return req; }; /** * Just drops the config on the floor, but returns req in case * the config return value is used. */ req.config = function (cfg) { return req(cfg); }; /** * Expose module registry for debugging and tooling */ requirejs._defined = defined; define = function (name, deps, callback) { //This module may not have dependencies if (!deps.splice) { //deps is not an array, so probably means //an object literal or factory function for //the value. Adjust args. callback = deps; deps = []; } if (!hasProp(defined, name) && !hasProp(waiting, name)) { waiting[name] = [name, deps, callback]; } }; define.amd = { jQuery: true }; }()); almond-0.2.9/bower.json000066400000000000000000000001701226333677700150230ustar00rootroot00000000000000{ "name": "almond", "version": "0.2.9", "main": "almond.js", "ignore": [ "tests", "shrinktest.sh" ] } almond-0.2.9/package.json000066400000000000000000000014051226333677700153020ustar00rootroot00000000000000{ "name": "almond", "description": "A minimal AMD API implementation for use in optimized browser builds.", "version": "0.2.9", "homepage": "http://github.com/jrburke/almond", "author": "James Burke (http://github.com/jrburke)", "repository": { "type": "git", "url": "git://github.com/jrburke/almond.git" }, "licenses": [ { "type": "BSD", "url": "https://github.com/jrburke/almond/blob/master/LICENSE" }, { "type": "MIT", "url": "https://github.com/jrburke/almond/blob/master/LICENSE" } ], "main": "almond.js", "engines": { "node": ">=0.4.0" }, "devDependencies": { "connect": "*" } } almond-0.2.9/shrinktest.sh000077500000000000000000000001641226333677700155520ustar00rootroot00000000000000#!/bin/sh rm almond.min.js.gz uglifyjs -c -m -o almond.min.js almond.js gzip almond.min.js ls -la almond.min.js.gz almond-0.2.9/tests/000077500000000000000000000000001226333677700141565ustar00rootroot00000000000000almond-0.2.9/tests/all.js000066400000000000000000000037611226333677700152730ustar00rootroot00000000000000 doh.registerUrl("simple", "../simple.html"); doh.registerUrl("defineDouble", "../defineDouble/defineDouble.html"); doh.registerUrl("moduleConfig", "../moduleConfig/moduleConfig.html"); doh.registerUrl("mapConfig", "../mapConfig/mapConfig.html"); doh.registerUrl("mapConfigStar", "../mapConfig/mapConfigStar.html"); doh.registerUrl("mapConfigStarAdapter", "../mapConfig/mapConfigStarAdapter.html"); doh.registerUrl("mapConfigSpecificity", "../mapConfig/mapConfigSpecificity.html"); doh.registerUrl("mapConfigPlugin", "../mapConfig/mapConfigPlugin.html"); doh.registerUrl("plugins", "../plugins/plugins.html"); doh.registerUrl("pluginsMapSameName", "../plugins/pluginMapSameName/pluginMapSameName.html"); doh.registerUrl("orderPlugin", "../plugins/order/order.html"); doh.registerUrl("text", "../plugins/text.html"); doh.registerUrl("coffee", "../plugins/coffee.html"); doh.registerUrl("shim", "../shim/shim.html"); doh.registerUrl("unorderedSeparate", "../unordered/separate.html"); doh.registerUrl("emptyFactory", "../emptyFactory/emptyFactory.html"); doh.registerUrl("missing", "../missing/missing.html"); doh.registerUrl("insertRequire", "../insertRequire/insertRequire.html", 4000); doh.registerUrl("circular", "../circular/circular.html"); doh.registerUrl("circular414", "../circular/414/414.html"); doh.registerUrl("circularTranspiler", "../circular/transpiler/transpiler.html"); doh.registerUrl("relativePaths", "../relativePaths/relativePaths.html"); doh.registerUrl("errback", "../errback/errback.html"); doh.registerUrl("specialDeps", "../specialDeps/specialDeps.html"); doh.registerUrl("hasOwnPropertyTests", "../hasOwnProperty/hasOwnProperty.html"); doh.registerUrl("firstDefine", "../firstDefine/firstDefine.html"); doh.registerUrl("topRelativeRequire", "../topRelativeRequire/topRelativeRequire.html"); doh.registerUrl("configDeps", "../configDeps/configDeps.html"); doh.registerUrl("defineNoCallback", "../defineNoCallback/defineNoCallback.html"); doh.registerUrl("packagesNode", "../packagesNode/packagesNode.html"); almond-0.2.9/tests/circular/000077500000000000000000000000001226333677700157625ustar00rootroot00000000000000almond-0.2.9/tests/circular/414/000077500000000000000000000000001226333677700162725ustar00rootroot00000000000000almond-0.2.9/tests/circular/414/414.html000066400000000000000000000013321226333677700174670ustar00rootroot00000000000000 almond: requirejs#414: Multi-cycle Bundle Test

almond: requirejs#414: Multi-cycle Bundle Test

A set of modules have multiple cycles in them, but the require() that uses the top module in that bundle should get a fully constructed module set.More info.

Check console for messages

almond-0.2.9/tests/circular/414/414.js000066400000000000000000000036261226333677700171470ustar00rootroot00000000000000 define('C', [ "exports", "./MyClass", "./A", "./B" ], function (exports, MyClass, A, B) { exports.name = "C"; exports.say = function(){ return [MyClass.name, A.name, B.name, exports.name].join(','); }; } ); define('B', [ "exports", "./MyClass", "./A", "./C" ], function (exports, MyClass, A, C) { exports.name = "B"; exports.say = function(){ return [MyClass.name, A.name, exports.name, C.name].join(','); }; } ); define('A', [ "exports", "./MyClass", "./B", "./C" ], function (exports, MyClass, B, C) { exports.name = "A"; exports.say = function(){ return [MyClass.name, exports.name, B.name, C.name].join(','); }; } ); define('MyClass', [ "exports", "./A", "./B", "./C" ], function (exports, A, B, C) { exports.name = "MyClass"; exports.sayAll = function(){ return [ exports.say(), A.say(), B.say(), C.say() ].join(':'); }; exports.say = function(){ return [exports.name, A.name, B.name, C.name].join(','); }; return exports; } ); require({ baseUrl: requirejs.isBrowser ? './' : './circular/414' }, ["MyClass"], function(MyClass) { doh.register( "circular414", [ function circularComplexPlugin(t) { t.is("MyClass,A,B,C:MyClass,A,B,C:MyClass,A,B,C:MyClass,A,B,C", MyClass.sayAll()); } ] ); doh.run(); } ); define("414-tests", function(){}); almond-0.2.9/tests/circular/circular.html000066400000000000000000000036401226333677700204570ustar00rootroot00000000000000 almond: circular Test

almond: circular Test

Test circular dependencies with almond. More info: 17.

Check console for messages

almond-0.2.9/tests/circular/transpiler/000077500000000000000000000000001226333677700201455ustar00rootroot00000000000000almond-0.2.9/tests/circular/transpiler/transpiler.html000066400000000000000000000011601226333677700232140ustar00rootroot00000000000000 almond: Circular Transpiler Plugin Test

almond: Circular Transpiler Plugin Test

Test support for transpiled modules with cycles in them More info: 356.

Check console for messages

almond-0.2.9/tests/circular/transpiler/transpiler.js000066400000000000000000000141711226333677700226720ustar00rootroot00000000000000 /*jslint strict: false, plusplus: false */ /*global define: false, require: false, XMLHttpRequest: false, ActiveXObject: false, window: false, Packages: false, java: false, process: false */ (function () { //Load the text plugin, so that the XHR calls can be made. var buildMap = {}, fetchText, fs, progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0']; function createXhr() { //Would love to dump the ActiveX crap in here. Need IE 6 to die first. var xhr, i, progId; if (typeof XMLHttpRequest !== "undefined") { return new XMLHttpRequest(); } else { for (i = 0; i < 3; i++) { progId = progIds[i]; try { xhr = new ActiveXObject(progId); } catch (e) {} if (xhr) { progIds = [progId]; // so faster next time break; } } } if (!xhr) { throw new Error("require.getXhr(): XMLHttpRequest not available"); } return xhr; } if (typeof window !== "undefined" && window.navigator && window.document) { fetchText = function (url, callback) { var xhr = createXhr(); xhr.open('GET', url, true); xhr.onreadystatechange = function (evt) { //Do not explicitly handle errors, those should be //visible via console output in the browser. if (xhr.readyState === 4) { callback(xhr.responseText); } }; xhr.send(null); }; } else if (typeof process !== "undefined" && process.versions && !!process.versions.node) { //Using special require.nodeRequire, something added by r.js. fs = require.nodeRequire('fs'); fetchText = function (url, callback) { callback(fs.readFileSync(url, 'utf8')); }; } else if (typeof Packages !== 'undefined') { //Why Java, why is this so awkward? fetchText = function (url, callback) { var encoding = "utf-8", file = new java.io.File(url), lineSeparator = java.lang.System.getProperty("line.separator"), input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), stringBuffer, line, content = ''; try { stringBuffer = new java.lang.StringBuffer(); line = input.readLine(); // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 // http://www.unicode.org/faq/utf_bom.html // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 if (line && line.length() && line.charAt(0) === 0xfeff) { // Eat the BOM, since we've already found the encoding on this file, // and we plan to concatenating this buffer with others; the BOM should // only appear at the top of a file. line = line.substring(1); } stringBuffer.append(line); while ((line = input.readLine()) !== null) { stringBuffer.append(lineSeparator); stringBuffer.append(line); } //Make sure we return a JavaScript string and not a Java string. content = String(stringBuffer.toString()); //String } finally { input.close(); } callback(content); }; } define('refine',[],function () { return { load: function (name, parentRequire, load, config) { var url = parentRequire.toUrl(name + '.refine'); fetchText(url, function (text) { text = text.replace(/refine\s*\(/g, 'define('); if (config.isBuild) { buildMap[name] = text; } //Add in helpful debug line text += "\r\n//@ sourceURL=" + url; load.fromText(text); parentRequire([name], function (value) { load(value); }); }); }, write: function (pluginName, name, write) { if (name in buildMap) { var text = buildMap[name]; write.asModule(pluginName + "!" + name, text); } } }; }); }()); define('refine!c',['refine!a', 'exports'], function (a, exports) { exports.name = 'c'; exports.a = a; }); define('refine!b',['refine!c', 'exports'], function (c, exports) { exports.name = 'b'; exports.c = c; }); define('refine!a',['refine!b', 'exports'], function (b, exports) { exports.name = 'a'; exports.b = b; }); define('refine!e',['refine!d'], function(d) { function e() { return e.name + require('refine!d').name; } e.name = 'e'; return e; }); define('refine!d',['refine!e'], function(e) { function d() { return require('refine!e')(); } d.name = 'd'; return d; }); require({ baseUrl: requirejs.isBrowser ? './' : './circular/transpiler', paths: { 'text': '../../../../text/text', 'refine': '../../plugins/fromText/refine' } }, ["require", "refine!a", "refine!b", "refine!d"], function(require, a, b, d) { doh.register( "circularTranspiler", [ function circularTranspiler(t) { t.is("a", a.name); t.is("b", a.b.name); t.is("c", a.b.c.name); t.is("b", b.name); t.is("c", b.c.name); t.is("ed", d()); } ] ); doh.run(); } ); define("transpiler-tests", function(){}); almond-0.2.9/tests/configDeps/000077500000000000000000000000001226333677700162375ustar00rootroot00000000000000almond-0.2.9/tests/configDeps/configDeps.html000066400000000000000000000017331226333677700212120ustar00rootroot00000000000000 almond: configDeps Test

almond: configDeps Test

Make sure almond allows using config.deps. More info: 52.

Check console for messages

almond-0.2.9/tests/defineDouble/000077500000000000000000000000001226333677700165435ustar00rootroot00000000000000almond-0.2.9/tests/defineDouble/defineDouble.html000066400000000000000000000023671226333677700220260ustar00rootroot00000000000000 almond: Define Double Test

almond: Define Double Test

Make sure a double define only uses the first one. More info

Check console for messages

almond-0.2.9/tests/defineNoCallback/000077500000000000000000000000001226333677700173225ustar00rootroot00000000000000almond-0.2.9/tests/defineNoCallback/defineNoCallback.html000066400000000000000000000010141226333677700233500ustar00rootroot00000000000000 almond: Define with No Callback Test

almond: Define with No Callback Test

define() with no callback

Check console for messages

almond-0.2.9/tests/defineNoCallback/defineNoCallback.js000066400000000000000000000007541226333677700230320ustar00rootroot00000000000000 var obj = {}; define('c', false); //Test undefined exports. define('a', function () { obj.a = 'a'; }); define('b', ['c'], function(c) { obj.b = 'b'; obj.c = c; }); define('obj', ['a', 'b']); require(['obj'], function () { doh.register( 'defineNoCallback', [ function defineNoCallback(t){ t.is('a', obj.a); t.is('b', obj.b); t.is(false, obj.c); } ] ); doh.run(); }); almond-0.2.9/tests/doh/000077500000000000000000000000001226333677700147305ustar00rootroot00000000000000almond-0.2.9/tests/doh/LICENSE000066400000000000000000000261231226333677700157410ustar00rootroot00000000000000Dojo is available under *either* the terms of the modified BSD license *or* the Academic Free License version 2.1. As a recipient of Dojo, you may choose which license to receive this code under (except as noted in per-module LICENSE files). Some modules may not be the copyright of the Dojo Foundation. These modules contain explicit declarations of copyright in both the LICENSE files in the directories in which they reside and in the code itself. No external contributions are allowed under licenses which are fundamentally incompatible with the AFL or BSD licenses that Dojo is distributed under. The text of the AFL and BSD licenses is reproduced below. ------------------------------------------------------------------------------- The "New" BSD License: ********************** Copyright (c) 2005-2009, The Dojo Foundation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Dojo Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- The Academic Free License, v. 2.1: ********************************** This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work: Licensed under the Academic Free License version 2.1 1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following: a) to reproduce the Original Work in copies; b) to prepare derivative works ("Derivative Works") based upon the Original Work; c) to distribute copies of the Original Work and Derivative Works to the public; d) to perform the Original Work publicly; and e) to display the Original Work publicly. 2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works. 3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work. 4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license. 5) This section intentionally omitted. 6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer. 8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions. 10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License. 12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. 13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. 14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner. almond-0.2.9/tests/doh/README000066400000000000000000000010001226333677700155770ustar00rootroot00000000000000DOH may be run standalone by issuing a command like the following: java -jar ../shrinksafe/js.jar runner.js testModule=tests.colors where the testModule argument is optional and shrinksafe/js.jar is just a convenient copy of the Rhino JavaScript engine -- the custom patch is not required. Optional arguments include: * dojoUrl - specifies the location of dojo.js * testUrl - specifies a Javascript file to load with initialization code * testModule - specifies a test module in the dojo package namespace almond-0.2.9/tests/doh/_browserRunner.js000066400000000000000000000605771226333677700203210ustar00rootroot00000000000000if(window["dojo"]){ dojo.provide("doh._browserRunner"); } // FIXME: need to add prompting for monkey-do testing (function(){ doh.setTimeout = function (fn, time) { return setTimeout(fn, time); }; try{ var topdog = (window.parent == window) || !Boolean(window.parent.doh); }catch(e){ //can't access window.parent.doh, then consider ourselves as topdog topdog=true; } if(topdog){ // we're the top-dog window. // borrowed from Dojo, etc. var byId = function(id){ return document.getElementById(id); }; var _addOnEvt = function( type, // string refOrName, // function or string scope){ // object, defaults is window if(!scope){ scope = window; } var funcRef = refOrName; if(typeof refOrName == "string"){ funcRef = scope[refOrName]; } var enclosedFunc = function(){ return funcRef.apply(scope, arguments); }; if((window["dojo"])&&(type == "load")){ dojo.addOnLoad(enclosedFunc); }else{ if(window["attachEvent"]){ window.attachEvent("on"+type, enclosedFunc); }else if(window["addEventListener"]){ window.addEventListener(type, enclosedFunc, false); }else if(document["addEventListener"]){ document.addEventListener(type, enclosedFunc, false); } } }; // // Over-ride or implement base runner.js-provided methods // var escapeXml = function(str){ //summary: // Adds escape sequences for special characters in XML: &<>"' // Optionally skips escapes for single quotes return str.replace(/&/gm, "&").replace(//gm, ">").replace(/"/gm, """); // string }; var _logBacklog = [], _loggedMsgLen = 0; var sendToLogPane = function(args, skip){ var msg = ""; for(var x=0; x "); if(!byId("logBody")){ _logBacklog.push(msg); return; }else if(_logBacklog.length && !skip){ var tm; while((tm=_logBacklog.shift())){ sendToLogPane(tm, true); } } var logBody=byId("logBody"); var tn = document.createElement("div"); tn.innerHTML = msg; //tn.id="logmsg_"+logBody.childNodes.length; logBody.appendChild(tn); _loggedMsgLen++; } var findTarget = function(n){ while(n && !n.getAttribute('_target')){ n=n.parentNode; if(!n.getAttribute){ n=null; } } return n; } doh._jumpToLog = function(e){ //console.log(e); var node = findTarget(e?e.target:window.event.srcElement); if(!node){ return; } var _t = Number(node.getAttribute('_target')); var lb = byId("logBody"); if(_t>=lb.childNodes.length){ return; } var t = lb.childNodes[_t]; t.scrollIntoView(); if(window.dojo){ //t.parentNode.parentNode is
, only it has a explicitly set background-color, //all children of it are transparent var bgColor = dojo.style(t.parentNode.parentNode,'backgroundColor'); //node.parentNode is the tr which has background-color set explicitly var hicolor = dojo.style(node.parentNode,'backgroundColor'); var unhilight = dojo.animateProperty({ node: t, duration: 500, properties: { backgroundColor: { start:hicolor, end: bgColor } }, onEnd: function(){ t.style.backgroundColor=""; } }); var hilight = dojo.animateProperty({ node: t, duration: 500, properties: { backgroundColor: { start:bgColor, end: hicolor } }, onEnd: function(){ unhilight.play(); } }); hilight.play(); } }; doh._jumpToSuite = function(e){ var node = findTarget(e ? e.target : window.event.srcElement); if(!node){ return; } var _g = node.getAttribute('_target'); var gn = getGroupNode(_g); if(!gn){ return; } gn.scrollIntoView(); }; doh._init = (function(oi){ return function(){ var lb = byId("logBody"); if(lb){ // clear the console before each run while(lb.firstChild){ lb.removeChild(lb.firstChild); } _loggedMsgLen = 0; } this._totalTime = 0; this._suiteCount = 0; oi.apply(doh, arguments); } })(doh._init); doh._setupGroupForRun = (function(os){ //overload _setupGroupForRun to record which log line to jump to when a suite is clicked return function(groupName){ var tg = doh._groups[groupName]; doh._curTestCount = tg.length; doh._curGroupCount = 1; var gn = getGroupNode(groupName); if(gn){ //two lines will be added, scroll the second line into view gn.getElementsByTagName("td")[2].setAttribute('_target',_loggedMsgLen+1); } os.apply(doh,arguments); } })(doh._setupGroupForRun); doh._report = (function(or){ //overload _report to insert a tfoot return function(){ var tb = byId("testList"); if(tb){ var tfoots=tb.getElementsByTagName('tfoot'); if(tfoots.length){ tb.removeChild(tfoots[0]); } var foot = tb.createTFoot(); var row = foot.insertRow(-1); row.className = 'inProgress'; var cell=row.insertCell(-1); cell.colSpan=2; cell.innerHTML="Result"; cell = row.insertCell(-1); cell.innerHTML=this._testCount+" tests in "+this._groupCount+" groups /"+this._errorCount+" errors, "+this._failureCount+" failures"; cell.setAttribute('_target',_loggedMsgLen+1); row.insertCell(-1).innerHTML=doh._totalTime+"ms"; } //This location can do the final performance rendering for the results //of any performance tests. var plotResults = null; var standby; if(doh.perfTestResults){ if(window.dojo){ //If we have dojo and here are perf tests results, //well, we'll use the dojo charting functions dojo.require("dojox.charting.Chart2D"); dojo.require("dojox.charting.DataChart"); dojo.require("dojox.charting.plot2d.Scatter"); dojo.require("dojox.charting.plot2d.Lines"); dojo.require("dojo.data.ItemFileReadStore"); plotResults = doh._dojoPlotPerfResults; }else{ plotResults = doh._asciiPlotPerfResults; } try{ var g; var pBody = byId("perfTestsBody"); var chartsToRender = []; if(doh.perfTestResults){ doh.showPerfTestsPage(); } for(g in doh.perfTestResults){ var grp = doh.perfTestResults[g]; var hdr = document.createElement("h1"); hdr.appendChild(document.createTextNode("Group: " + g)); pBody.appendChild(hdr); var ind = document.createElement("blockquote"); pBody.appendChild(ind); var f; for(f in grp){ var fResults = grp[f]; if(!fResults){ continue; } var fhdr = document.createElement("h3"); fhdr.appendChild(document.createTextNode("TEST: " + f)); fhdr.style.textDecoration = "underline"; ind.appendChild(fhdr); var div = document.createElement("div"); ind.appendChild(div); //Figure out the basic info var results = "TRIAL SIZE: " + fResults.trials[0].testIterations + " iterations
" + "NUMBER OF TRIALS: " + fResults.trials.length + "
"; //Figure out the average test pass cost. var i; var iAvgArray = []; var tAvgArray = []; for(i = 0; i < fResults.trials.length; i++){ iAvgArray.push(fResults.trials[i].average); tAvgArray.push(fResults.trials[i].executionTime); } results += "AVERAGE TRIAL EXECUTION TIME: " + doh.average(tAvgArray).toFixed(10) + "ms.
"; results += "MAXIMUM TEST ITERATION TIME: " + doh.max(iAvgArray).toFixed(10) + "ms.
"; results += "MINIMUM TEST ITERATION TIME: " + doh.min(iAvgArray).toFixed(10) + "ms.
"; results += "AVERAGE TEST ITERATION TIME: " + doh.average(iAvgArray).toFixed(10) + "ms.
"; results += "MEDIAN TEST ITERATION TIME: " + doh.median(iAvgArray).toFixed(10) + "ms.
"; results += "VARIANCE TEST ITERATION TIME: " + doh.variance(iAvgArray).toFixed(10) + "ms.
"; results += "STANDARD DEVIATION ON TEST ITERATION TIME: " + doh.standardDeviation(iAvgArray).toFixed(10) + "ms.
"; //Okay, attach it all in. div.innerHTML = results; div = document.createElement("div"); div.innerHTML = "

Average Test Execution Time (in milliseconds, with median line)

"; ind.appendChild(div); div = document.createElement("div"); dojo.style(div, "width", "600px"); dojo.style(div, "height", "250px"); ind.appendChild(div); chartsToRender.push({ div: div, title: "Average Test Execution Time", data: iAvgArray }); div = document.createElement("div"); div.innerHTML = "

Average Trial Execution Time (in milliseconds, with median line)

"; ind.appendChild(div); div = document.createElement("div"); dojo.style(div, "width", "600px"); dojo.style(div, "height", "250px"); ind.appendChild(div); chartsToRender.push({ div: div, title: "Average Trial Execution Time", data: tAvgArray }); } } //Lazy-render these to give the browser time and not appear locked. var delayedRenders = function() { if(chartsToRender.length){ var chartData = chartsToRender.shift(); plotResults(chartData.div, chartData.title, chartData.data); } doh.setTimeout(delayedRenders, 50); }; doh.setTimeout(delayedRenders, 150); }catch(e){ doh.debug(e); } } or.apply(doh,arguments); } })(doh._report); if(this["opera"] && opera.postError){ doh.debug = function(){ var msg = ""; for(var x=0; x
 
"; tds[3].innerHTML = ""; tb.appendChild(tg); return tg; } var addFixtureToList = function(group, fixture){ if(!testTemplate){ return; } var cgn = groupNodes[group]; if(!cgn["__items"]){ cgn.__items = []; } var tn = testTemplate.cloneNode(true); var tds = tn.getElementsByTagName("td"); tds[2].innerHTML = fixture.name; tds[3].innerHTML = ""; var nn = (cgn.__lastFixture||cgn.__groupNode).nextSibling; if(nn){ nn.parentNode.insertBefore(tn, nn); }else{ cgn.__groupNode.parentNode.appendChild(tn); } // FIXME: need to make group display toggleable!! tn.style.display = "none"; cgn.__items.push(tn); return (cgn.__lastFixture = tn); } var getFixtureNode = function(group, fixture){ if(groupNodes[group]){ return groupNodes[group][fixture.name]; } return null; } var getGroupNode = function(group){ if(groupNodes[group]){ return groupNodes[group].__groupNode; } return null; } var updateBacklog = []; doh._updateTestList = function(group, fixture, unwindingBacklog){ if(!loaded){ if(group && fixture){ updateBacklog.push([group, fixture]); } return; }else if(updateBacklog.length && !unwindingBacklog){ var tr; while((tr=updateBacklog.shift())){ doh._updateTestList(tr[0], tr[1], true); } } if(group && fixture){ if(!groupNodes[group]){ groupNodes[group] = { "__groupNode": addGroupToList(group) }; } if(!groupNodes[group][fixture.name]){ groupNodes[group][fixture.name] = addFixtureToList(group, fixture) } } } doh._testRegistered = doh._updateTestList; doh._groupStarted = function(group){ if(this._suiteCount == 0){ this._runedSuite = 0; this._currentGlobalProgressBarWidth = 0; this._suiteCount = this._testCount; } // console.debug("_groupStarted", group); if(doh._inGroup != group){ doh._groupTotalTime = 0; doh._runed = 0; doh._inGroup = group; this._runedSuite++; } var gn = getGroupNode(group); if(gn){ gn.className = "inProgress"; } } doh._groupFinished = function(group, success){ // console.debug("_groupFinished", group); var gn = getGroupNode(group); if(gn && doh._inGroup == group){ doh._totalTime += doh._groupTotalTime; gn.getElementsByTagName("td")[3].innerHTML = doh._groupTotalTime+"ms"; gn.getElementsByTagName("td")[2].lastChild.className = ""; doh._inGroup = null; //doh._runedSuite++; var failure = doh._updateGlobalProgressBar(this._runedSuite/this._groupCount,success,group); gn.className = failure ? "failure" : "success"; //doh._runedSuite--; doh._currentGlobalProgressBarWidth = parseInt(this._runedSuite/this._groupCount*10000)/100; //byId("progressOuter").style.width = parseInt(this._runedSuite/this._suiteCount*100)+"%"; } if(doh._inGroup == group){ this.debug("Total time for GROUP \"",group,"\" is ",doh._groupTotalTime,"ms"); } } doh._testStarted = function(group, fixture){ // console.debug("_testStarted", group, fixture.name); var fn = getFixtureNode(group, fixture); if(fn){ fn.className = "inProgress"; } } var _nameTimes = {}; var _playSound = function(name){ if(byId("hiddenAudio") && byId("audio") && byId("audio").checked){ // console.debug("playing:", name); var nt = _nameTimes[name]; // only play sounds once every second or so if((!nt)||(((new Date)-nt) > 700)){ _nameTimes[name] = new Date(); var tc = document.createElement("span"); byId("hiddenAudio").appendChild(tc); tc.innerHTML = ''; } } } doh._updateGlobalProgressBar = function(p,success,group){ var outerContainer=byId("progressOuter"); var gdiv=outerContainer.childNodes[doh._runedSuite-1]; if(!gdiv){ gdiv=document.createElement('div'); outerContainer.appendChild(gdiv); gdiv.className='success'; gdiv.setAttribute('_target',group); } if(!success && !gdiv._failure){ gdiv._failure=true; gdiv.className='failure'; if(group){ gdiv.setAttribute('title','failed group '+group); } } var tp=parseInt(p*10000)/100; gdiv.style.width = (tp-doh._currentGlobalProgressBarWidth)+"%"; return gdiv._failure; } doh._testFinished = function(group, fixture, success){ var fn = getFixtureNode(group, fixture); var elapsed = fixture.endTime-fixture.startTime; if(fn){ fn.getElementsByTagName("td")[3].innerHTML = elapsed+"ms"; fn.className = (success) ? "success" : "failure"; fn.getElementsByTagName("td")[2].setAttribute('_target', _loggedMsgLen); if(!success){ _playSound("doh"); var gn = getGroupNode(group); if(gn){ gn.className = "failure"; _getGroupToggler(group)(null, true); } } } if(doh._inGroup == group){ var gn = getGroupNode(group); doh._runed++; if(gn && doh._curTestCount){ var p = doh._runed/doh._curTestCount; var groupfail = this._updateGlobalProgressBar((doh._runedSuite+p-1)/doh._groupCount,success,group); var pbar = gn.getElementsByTagName("td")[2].lastChild; pbar.className = groupfail?"failure":"success"; pbar.style.width = parseInt(p*100)+"%"; gn.getElementsByTagName("td")[3].innerHTML = parseInt(p*10000)/100+"%"; } } this._groupTotalTime += elapsed; this.debug((success ? "PASSED" : "FAILED"), "test:", fixture.name, elapsed, 'ms'); } // FIXME: move implementation to _browserRunner? doh.registerUrl = function( /*String*/ group, /*String*/ url, /*Integer*/ timeout){ var tg = new String(group); this.register(group, { name: url, setUp: function(){ doh.currentGroupName = tg; doh.currentGroup = this; doh.currentUrl = url; this.d = new doh.Deferred(); doh.currentTestDeferred = this.d; doh.showTestPage(); byId("testBody").src = url; }, timeout: timeout||10000, // 10s // timeout: timeout||1000, // 10s runTest: function(){ // FIXME: implement calling into the url's groups here!! return this.d; }, tearDown: function(){ doh.currentGroupName = null; doh.currentGroup = null; doh.currentTestDeferred = null; doh.currentUrl = null; // this.d.errback(false); // byId("testBody").src = "about:blank"; doh.showLogPage(); } }); } // // Utility code for runner.html // // var isSafari = navigator.appVersion.indexOf("Safari") >= 0; var tabzidx = 1; var _showTab = function(toShow, toHide){ // FIXME: I don't like hiding things this way. var i; for(i = 0; i < toHide.length; i++){ var node = byId(toHide[i]); if(node){ node.style.display="none"; } } toShow = byId(toShow); if(toShow){ with(toShow.style){ display = ""; zIndex = ++tabzidx; } } } doh.showTestPage = function(){ _showTab("testBody", ["logBody", "perfTestsBody"]); } doh.showLogPage = function(){ _showTab("logBody", ["testBody", "perfTestsBody"]); } doh.showPerfTestsPage = function(){ _showTab("perfTestsBody", ["testBody", "logBody"]); } var runAll = true; doh.toggleRunAll = function(){ // would be easier w/ query...sigh runAll = !runAll; if(!byId("testList")){ return; } var tb = byId("testList").tBodies[0]; var inputs = tb.getElementsByTagName("input"); var x=0; var tn; while((tn=inputs[x++])){ tn.checked = runAll; doh._groups[tn.group].skip = (!runAll); } } var listHeightTimer = null; var setListHeight = function(){ if(listHeightTimer){ clearTimeout(listHeightTimer); } var tl = byId("testList"); if(!tl){ return; } listHeightTimer = doh.setTimeout(function(){ tl.style.display = "none"; tl.style.display = ""; }, 10); } _addOnEvt("resize", setListHeight); _addOnEvt("load", setListHeight); _addOnEvt("load", function(){ if(loaded){ return; } loaded = true; groupTemplate = byId("groupTemplate"); if(!groupTemplate){ // make sure we've got an ammenable DOM structure return; } groupTemplate.parentNode.removeChild(groupTemplate); groupTemplate.style.display = ""; testTemplate = byId("testTemplate"); testTemplate.parentNode.removeChild(testTemplate); testTemplate.style.display = ""; doh._updateTestList(); }); _addOnEvt("load", function(){ // let robot code run if it gets to this first var __onEnd = doh._onEnd; doh._onEnd = function(){ __onEnd.apply(doh, arguments); if(doh._failureCount == 0){ doh.debug("WOOHOO!!"); _playSound("woohoo"); }else{ console.debug("doh._failureCount:", doh._failureCount); } if(byId("play")){ toggleRunning(); } } if(!byId("play")){ // make sure we've got an amenable DOM structure return; } var isRunning = false; var toggleRunning = function(){ // ugg, this would be so much better w/ dojo.query() if(isRunning){ byId("play").style.display = byId("pausedMsg").style.display = ""; byId("playingMsg").style.display = byId("pause").style.display = "none"; isRunning = false; }else{ byId("play").style.display = byId("pausedMsg").style.display = "none"; byId("playingMsg").style.display = byId("pause").style.display = ""; isRunning = true; } } doh.run = (function(oldRun){ return function(){ if(!doh._currentGroup){ toggleRunning(); } return oldRun.apply(doh, arguments); } })(doh.run); var btns = byId("toggleButtons").getElementsByTagName("span"); var node; var idx=0; while((node=btns[idx++])){ node.onclick = toggleRunning; } //Performance report generating functions! doh._dojoPlotPerfResults = function(div, name, dataArray) { var median = doh.median(dataArray); var medarray = []; var i; for(i = 0; i < dataArray.length; i++){ medarray.push(median); } var data = { label: "name", items: [ {name: name, trials: dataArray}, {name: "Median", trials: medarray} ] }; var ifs = new dojo.data.ItemFileReadStore({data: data}); var min = Math.floor(doh.min(dataArray)); var max = Math.ceil(doh.max(dataArray)); var step = (max - min)/10; //Lets try to pad out the bottom and top a bit //Then recalc the step. if(min > 0){ min = min - step; if(min < 0){ min = 0; } min = Math.floor(min); } if(max > 0){ max = max + step; max = Math.ceil(max); } step = (max - min)/10; var chart = new dojox.charting.DataChart(div, { type: dojox.charting.plot2d.Lines, displayRange:dataArray.length, xaxis: {min: 1, max: dataArray.length, majorTickStep: Math.ceil((dataArray.length - 1)/10), htmlLabels: false}, yaxis: {min: min, max: max, majorTickStep: step, vertical: true, htmlLabels: false} }); chart.setStore(ifs, {name:"*"}, "trials"); }; doh._asciiPlotPerfResults = function(){ //TODO: Implement! }; } ); }else{ // we're in an iframe environment. Time to mix it up a bit. _doh = window.parent.doh; var _thisGroup = _doh.currentGroupName; var _thisUrl = _doh.currentUrl; if(_thisGroup){ doh._testRegistered = function(group, tObj){ _doh._updateTestList(_thisGroup, tObj); } doh._onEnd = function(){ _doh._errorCount += doh._errorCount; _doh._failureCount += doh._failureCount; _doh._testCount += doh._testCount; // should we be really adding raw group counts? //_doh._groupCount += doh._groupCount; _doh.currentTestDeferred.callback(true); } var otr = doh._getTestObj; doh._getTestObj = function(){ var tObj = otr.apply(doh, arguments); tObj.name = _thisUrl+"::"+arguments[0]+"::"+tObj.name; return tObj; } doh.debug = doh.hitch(_doh, "debug"); doh.registerUrl = doh.hitch(_doh, "registerUrl"); doh._testStarted = function(group, fixture){ _doh._testStarted(_thisGroup, fixture); } doh._testFinished = function(g, f, s){ _doh._testFinished(_thisGroup, f, s); //Okay, there may be performance info we need to filter back //to the parent, so do that here. if(doh.perfTestResults){ try{ gName = g.toString(); var localFName = f.name; while(localFName.indexOf("::") >= 0){ localFName = localFName.substring(localFName.indexOf("::") + 2, localFName.length); } if(!_doh.perfTestResults){ _doh.perfTestResults = {}; } if(!_doh.perfTestResults[gName]){ _doh.perfTestResults[gName] = {}; } _doh.perfTestResults[gName][f.name] = doh.perfTestResults[gName][localFName]; }catch (e){ doh.debug(e); } } } doh._groupStarted = function(g){ if(!this._setParent){ _doh._curTestCount = this._testCount; _doh._curGroupCount = this._groupCount; this._setParent = true; } } doh._report = function(){ }; } } })(); almond-0.2.9/tests/doh/_nodeRunner.js000066400000000000000000000010171226333677700175430ustar00rootroot00000000000000 /*global doh: false, process: false */ var aps = Array.prototype.slice; doh.debug = function () { //Could have multiple args, join them all together. var msg = aps.call(arguments, 0).join(' '); console.log(msg); }; // Override the doh._report method to make it quit with an // appropriate exit code in case of test failures. var oldReport = doh._report; doh._report = function () { oldReport.apply(doh, arguments); if (this._failureCount > 0 || this._errorCount > 0) { process.exit(1); } }; almond-0.2.9/tests/doh/_rhinoRunner.js000066400000000000000000000005631226333677700177420ustar00rootroot00000000000000if(this["dojo"]){ dojo.provide("doh._rhinoRunner"); } doh.debug = print; // Override the doh._report method to make it quit with an // appropriate exit code in case of test failures. (function(){ var oldReport = doh._report; doh._report = function(){ oldReport.apply(doh, arguments); if(this._failureCount > 0 || this._errorCount > 0){ quit(1); } } })(); almond-0.2.9/tests/doh/_sounds/000077500000000000000000000000001226333677700164025ustar00rootroot00000000000000almond-0.2.9/tests/doh/_sounds/LICENSE000066400000000000000000000005261226333677700174120ustar00rootroot00000000000000License Disclaimer: All contents of this directory are Copyright (c) the Dojo Foundation, with the following exceptions: ------------------------------------------------------------------------------- woohoo.wav, doh.wav, dohaaa.wav: * Copyright original authors. Copied from: http://simpson-homer.com/homer-simpson-soundboard.html almond-0.2.9/tests/doh/_sounds/doh.wav000066400000000000000000000054761226333677700177070ustar00rootroot00000000000000RIFF6 WAVEfmt U"V  hqfactU5dataø ÿó@ÄÁQѹIHÿ÷nPÁ‚0L7  b!C ŠÉä@IC ŠÃk Š\VO"DÁ`™:Á@ÄB† ŠÉÒ £6Ô 1¿Â„<-tz  P('zŸ †b Ð¬h6¤&ÿó@Ä ÂÊ[ŒHDt‚ 30Ì«2b;¯ ¿èìœyæ¿ìyáÿèÒ] ‰Gÿý†^ÁÃYoÿÿá9\•$™e#ÿÿÿÛ„Þvã&žõ?í!Ý-Xmÿ3?¿B-’hj6ÿó@ÄB:âYŒ@àDÞYVZ7¹ÂezÓg«ÖÓN4À¨º­1IÍR?N]x©M½…"Oâ®C³ÔTGÍ<¡8¢Íáïûÿmv¡ÏwN=;C.ÿÿÿý:´¿¾g~Ë„ ñ5‘×ÿó@ÄBFèŠ@zP’&¿õÀ½¯ÌO·ý_5r7ÿ7õÚÿßµsòïüò]wH´‹# J±àÞ $ZLÜrOé8‡%‚‰ uÕøŒ4!r €Ç¿ÇþP€€ À½­ÿó@Ä ‚å•Ï@ÖËpõõX£×ôôí‹2cþ`¤cQ@†Àø¥Ûÿ$|ÿÂ[Ÿb‡_?ü9×ÿvÃHc hýIx„è”]ÅZÕ·_z­:ÿ‡«„ø ‹ö>4£–±s¿ÿó@ÄA:åö3ÊT›Ö$ƒölçY‰ëÌчµl‡K:{¨ïò qFWF#ƒ0µo’¢¢±‚p#]jæ‡ £{?¼RÅ k"VŠ=Ix˜HP,Á ª4¿9±0r…æÍ ežÃnOÿó@ÄBâ>zÆÄMNº#I¤9í¤ª.þÇÜ „ßþ¨˜'Át`bóÍ*žó¥¯$p—C=Ê<¨`èN¤¢ŽB£à@Ó6y­šC ’†s¶­FJG ‡´mø³+c éÈÇYjÿó@Ä!A>ÝNcÊ¨Ž þúG9¿Dp£S S¹*80ɵŽZ‘ ”s £CÅ ™ÿPöœYj kzèxŸ˜Ì‘†J0ë‘——ØÞ±‡%4g¶‹û>’ϰ—1Œš\7T²c˜ÚjX ÿó@Ä+Šâ+ÄTE°—+83©µ6ä3–FLkX—X«ŸwÙ ÓùÓô´¯€Š:ú›³å“g7íŒ]þ &3]Bƒ ÕtýZGÏÔüüà k6Éè)B`¢6,ÿó@Ä8:æ6`ÌÔe AäŒ_:ÐÉê±ãd‚…í_{t¿þPŒ€`ÏÞÁ¬òùµæÞÈXBPGÕ† o3y‡ W3†ÅàŽs„q‡3+431Ù#™+X,L"W&‰C 66]†ÿó@ÄCfæ63ÆLÅk Í0p&õ:±øÃÔÊÿpý [dFú—Që--¨°bR¸ÀÆ.TI ª*Õk•‡3êWR¨ôþƒТ(Œª¿I¸€&ßLðÀ:9WçV#¡®cxÿó@ÄJ^Þ6KÊLĪüºåΙ P ,¢»‰Ð“yE½_AŠ9‘Fs »±œÏbîÄÍDüÚ(MRÃCÇÝÕÆCê€Ìœ»`ÐR^’2ê!õ:×zƒÍ:ç Ï\ÿó@ÄS^ݾ“Ê„Ôb ;ÄãüËhBÀSj×~±ý!!­S?QcÎï¤]Œ+d×ùtA½W׌Ynovôä&Ge×Egys3-èÊvþ¢àÏþykð•£Ê”`ûÿó@Ä\‚Zâ^+Êt•¦%ÖdÄÞ\//F¡Ñ´`BLÕEIˆ*ÿÌîôúž³×ȨéE³²˜Ó&×¼¦}ª®ì–9ôaÄ‘8(_ñ/À'ƒ‡Ž´·AQÔ‰æM»ß¬7Šûu%¤û­ÿó@ÄiÂVݼ4DLüÈ9œ¢opkô`0¥³«œ /Ôà@B‘ªs•6ÓvB¯FÞ›ôýu-nHpÀ!"*PQ²øðº2ÃH™¢&k¤G“,½Uqp—_÷oé]‡ 0JÄàŸÿó@ÄuêfÍFM¨†×úìµod@{ñ[iV²ŒªÊËßÿ[×ø ¢ƒ8* kþ˜?€[šT€€H5dPt ˜…Eê©C„Õޟļ§Àçîºa™q Š2²fI|ëìà™Jcÿó@Ä€ÂJÕ¼˜ÅPlmÏ‘®«?2ú~´»Òý¿ÿ?*¥j€‰ÅÅV Œþ¡šLÿ€²"€|5ŽYk˜]otïOÎ*‚Oî“~Æ!aÜYÍôÙƒµ;á껺?ÉÒv”ûÿó@ÄŒÂ>ѾDÆLýš¤'BòÉ ÿó>Â)¯k Qk÷ÿ/Ø´QâÀW¿¢¸‚Âà„²ë7#ËùA ¸ŒçWð[3Ýs{FZ ;nÇbáoUOf¡&ðèµKwR/‘ºkJqf6¬¦ÿó@Äê ;ÁFmº:£ær©·£þ­î[•ÈÖ×ÿ³r;%¶ÈÓƒqc-(<€ Œà Û9¸-,1kŸ„\ÙÍ$\&@¦r…7+m¥È˱ñ.%Iœ5IùDpPW0¾i–…é ÿó@Ä“2®Þ^Y„õ ½óhÿxt6`jŒþ÷hN8ÔÉ8ìiç«!Á:sØÁ7ÛR” + ‘&à PèÔ”¼FÍA)ÚtiÌJMk 8°š5#’5¬$¥’|•Q¨šj,uUNz9dÿó@Ä•A–ÉxF¥a`Á‰Q_øwÁTWâÿ…Ïù‚®n8’MÆý…]sù}°Sz‰¸^gñé‘$zF’,°n¤øå2d6G”*‡òÉHÿ–ËòËe/ûÿ·úË(4r5` –YAÿó@Ä—yJɾK !¡“#:ÅE¾€dTXÿó@Ä zܶf LR‚Ö‚€)œ£Ç—£î\¨5·¶¬<²²cºg‘û™{¹¯-Ï&Nïsbw.";=Bˆ!{=1P³›>ŒáÍeÅÿÀB€Ë1(a+“ì®t‡5²âhïÿó@ÄÁܶKÌ<–q±l|g¸Î럸͆ „,¤š¿8]›¼éᩜ¢³Ð„V¬ò΢"UG¶ýqp _ÀÜ!œÏÑ[ZhZìéÓuû FŠ]‹»û‚»ÁÑõ·¢x¿ÿó@Ä&*á^cÆèõß¶7ö=DŒæF¾Ì[‚WXd‘’ ý!"=; ¤‹@ß)Ñä˜S¢’khÛUkÕ5kăŠÕž³ŽXW“Ì $ÙMË’À4®+âÕþ›Ûÿó@Ä5Á2Ðf¨Ôpî7—}7bFîOëjE•Ò¤vù1T½Àk"ÙYößvâ’ÏÜ«[Û0øF?~ö°*»(× ìÔiX(LÛ½a¹8‘†â?ÚÂ×sH°Å¿6öâßvµëÿó@ÄE©2ØzG2Ò“n0I8sx½€¬O“šRQ܆_Qe¶ö«!v Ä)b;–#žÌа¹‰iƒLÁ3S¼ß¦Õ–ò‡§Á —¡À‰u +¾Áè)®¤/ÿ±©z²½ˆãåïZ9ÿó@ÄQÁ.ÜzG€f3éóF/v¡'!ÅÝàîh’½A/f#„¾Oì® PEvi@54´ÈW¶âSG7Ì?²±ÞÓBy6D” à U¿ÝÊÙw쓆-­Íæ»LB“î’¦}Å7¦ö¯þüŒc *„c¢*­¤Ú0¿*Ô­ª”‘@²NÌÇU¸ ³ee;¢ìŽ{©©jwx.ODîÞ÷òèg]¨ÿó@Ä1"¬4ÃÌQÀ¢˜ŒÚÿUàsŸ ?µj©€ ,>s"°&‚ìb"¹ìWhD.)6X¸*ÙdTÒ¾u \•GNæyF6¶5¦~¼ic ‹’J ¨Ï+ÿó@Ä™)*œ ËÌU©|I©ò[D&‰$—S:"á|€v0‰®€ˆA€•”6CbAY’Q©6±Y£ë9˜@qo(á k¶‹H•ÔR® Ø„9´ Z­ëzKœKžònNÈy4cBÿó@ÄŸ*” ÂLp!âª%ÝSŬ.;°­íqêrÉU ,€+NL≲—m¶­Ešµ Z@Ž“Ütt¬M+ L÷Ä9’µ*o:Ö˜DRïÔ8 ØI¹^_ú|"eÁ ¥›ÿó@ιþŒÂFY4¢ëåñ$Ãd1 T²€.-¥­ÐÍ9JeüQ A#T´3§£qSP4¡†Be¸“HŒ]µ…ˆ9Jp‹w@U¬ññ| º™¹T$cmÛ’©@æÿó@IJ±¾ŒÊFuQ«4(µ$a~ŽÀœHp‚U»A« !æ†ëI؈-7h`£LZŠ|)‰C;%äó]Hý˜¬Üß3dúHI ¿)£%Ôr‚ömÚ͑TdAáFZ &}À¥ÿó@ľñÖˆÊFYõGöøë±Xºù*‡ïéõ(µaíÐn(yá¨Ã£kQÝÊä]ûLo³q]%ø™Ý½Ä[ÓâÝâ Ì+=C²¤9kŸ%üa@UXÒ‰Á'Є9pÔXSŠOD–ÿó@ÄÅÁÆÂFM4*û«JUb ›<;Œ+»8„a×r\°ä R6žÄ/5ÝÂ9!G%D´BJHfi’¡ª<¬ÄiFö0)¹ÆB“òøh‰Óȯ8ñ¬:§TïòC¬íäiÿó@Äѱö€Ã yj"×{ŽÌ‚&’!Ô¥NtN·©! ƽÝ ]ØpÚü 7 ‰é0¸&Úíà  ŠÅ@ $‹p2‰ÇŠºh„:±ñØj×+ Ð!& z ˜ÿó@ÄͱþˆËU»*„ý:Kh²ƒ˜?Ã`~hZ †#OÒÚÐBR±3Kâ¢8¬VPXK€)#d‡O‚6€£ •*¤ØƒB&ßöe €e ÐÁéäŒ}‡Ý1–  ¡ÿó@Äѽ˜f\ŽT¥—×t¼Z(ï  Hej…t°åO4PŽÓã.Õ51"AZn"‘¬zÌÊx’." [Ô䈜Á­EnDz"Q_€ÿ€ã¢q·€QÌ!U„1KÓ„Bÿó@ÄÌ&Ì8KÒxJöÛ¦ÿ²Œ‘ÚÍ5 ȳ·[³Ô-݆©kŸ{?ߨ Y™«A–€L¶ñ®Ç¥`þ¨†®J3ï«^ÚëÿL›¿à^›•5Ç.GE!É~7n¬ì®½‰Æ´9ÿó@ÄÏAȶN x¶)atLL¤AcFYƒˆŸ JR\’{±µI>ñe»=ØéÝ¿îÆù {¿€eòð®˜ôOྠ¦Aˆ'"P§ªÿó@ÄÎÁÌN¬¥Œ:ïVea`åøMTò”<0Ú˜8o#y£²3P¢ A,‰dezb–òç±URŸµˆ* ¾]õò_%½·ë»@-N™z‰•< ŠrÞÜQ“95Xz€«ÿó@ÄÒAȾf­TÀ*iØŠP—Tx·ô7>¶ÕÂs8 ªLC00m2UÄ­<ó{±Ç&´µ;$ `ÍHó›Ä`G‰‡ 2µ¼0 „Œÿ9@ŠII¯bÃsm“p]:©œ-Œ ÿó@ÄÐÀîȾfYI5&”7Ê‹0霔5„|’’pŽoBf¨k© ¶¤[ñÝŒª,'I*íþí©6ŽCÕaž’~ßþÉ碠 ô9€H˜ÒÁAÂ2žZj3:Å@p!¯áÐÿó@ÄÐAľ~!½Cš£4Yf;\ÙU.'¢±iÑ9f/àýR¨YkEJA’#Q§ª†eý¿ÉnŒÀàæ2ïVÄ]øm7»ÅWniÞ¸G€AÐ4­l/€¨0"ÔVáÑ€S¦/ùÿó@ÄιÌËÒ­l ‘‹†ÇÕx1ž¯µÇf8žG„ia¼]b->‡&›6È+¤²B5É* (Úç§´3l¡úõý˜–0bQdO1VVVPF“nÇeq« J¨ ÄA —™Ïí§Ò°Å3Þ§ðÉ&Ň{÷+"ºB­1Sb(¤Edû—E¨UAëLQä¡£ÿó@ÄÐñr¨ÃÍc1ajNÏu)´u8„’œ÷¬AøáK߈‹æžÛÙS-2Ž××’Ç1—×`JÀ%¶ÃœÃ?yÙ|³H"$­åÖ`X–ž2eÂü2W„Ga+9 1”®Yÿó@ÄÏÁV¤Ëå™§­+Íõ8‘HÖ  ä*+2fñÃÙûͱ$Rú^ Ôt59¨ì·i?qã¿¥Â/¿3[zº/sú\÷ê)Y‰¬¯$ŠË 8ŸƒÇREùaÑ脟ïl6îK_*ÿó@ÄÏy”ÃÒ‘§/G£å´‡‰ÂI §F ‘xŒe"©#)kÇÛ®V+ã\ (NªDKœ<±^_J©B7Q³uy<+惃aƒ:«Œ@9ÂãÔÌ::N7‚ "Tÿó@ÄÐ~”ÃÌ‘BID¸5LšXÐÖÙf”Q—c"œ?WKÔZjÃâ@‰ë;˜àˆx@ã Ȇ’ËkÎ)­†tÜõȉËoLÄJ£PQ‚5– µ*\a4Ë%p‚’±tÄœR³ÿó@Äϱ¦ Á†¹}>\ÍÝ%Ú‚°âÑ£Î& 'Œ¸Efɦ³d™VÛ6Ei]J%á8y݉½Ébñ ƒ«Z!çüÖ[%©xŸã ‹zø¶(FÖ„H1y(å¨qÀèì0ž°tÉìÿó@ÄÓòˆÒF™1Dw îÄÑådåXÙQm¡b  à8 Å  %1!nð̃“PHÄÅI56¢¡*2[ %Ò ¹å ´í° ‚âG»@@†‚öˆ½*&;ަiÿó@ÄÔÂ„Ë Œ¦ïݺ”•ãkMl)"Œ¡ˆ(:ïuûOkab̸îÓ½(ŒF#÷êTX` Éçí¶Úûß²”Ö׿ìåÏ‚ ”f´Bø+3V‰.eΓ/üb“ÿó@ÄÐB„ÂFz­k]ÇUe1(‰¡Èu)áö_3ˆz5rU€–EÄQõG?ý®íb"f“& @¹=(£iÎâÎ5±F‚~9å4V>N€ƒötOyI¯'Gx¨LJŒ2ÿó@ÄÒFÁN|'FÔvyÒ¿N•áôAG ÀKåàMÕæZ¾Jg8×Íûm’€Ɖ¶ñëw#Õ…Ï©T1(X ‡G¬R¹?€d8S­¬§[ó¿eÑRóm³VêW(jäã„%ÿó@ÄÍ9RÙ}:¸Ÿ`e•D.;C %lD‘ Ð-wª—7-R‘áY†µž&Ÿ03¢…óAâ G±·ßÛ¨Óo M˜Ç /­þ´ó?€€Ÿ— ‹èKFØLX¥.úœCXÑ$ÍÃÿó@ÄËVÕVKÍ1Û FÓuXZ²¡\äŒgles„ù ',C¬¶²ªÊBqP­¯«HÕµˆDbQVïÿ•³¬ù¿Âqy'¥…¿Ç§àDgP£Q¨Ç&9œ^šl¸‡m?ò[«÷pÿó@ÄÔÁzÄzM€‘Pa±ULÁBÜKS”Ö'°‘ÒzzË b8þÛ0_Ÿ‡M9Fo-ÛdàµÇ‹:oûmØï>ö5"\Ë:ýßä›l{_ð` Äë*I#¨íj˜kÄþU ÂVÿó@ÄÐÁzÌ´cÒÌ3Mc;xâ¸4¡Ulê]ù}›—ØõT‹"0æy<½èe´˜¦_ö ±ÖˆI Á9¿ŽïÄs¿ó÷×ß5#xP8àUrÚK ‚µO_Þ\»ާ2ôq$Õí\–ÿó@ÄÐñRÌ~¿¹SME™ÓçŸìÄorÙs¾³Èˆˆ²É¹ê:¿¥•4k¦;Û[ñX‡é¡šh›ÿ_æ×Õ·jêÞ3$”¿·UÂÿ ñ©<^Rêw«û-¸·^“Z$ª’;Lÿó@ÄÏ©:ÐKÒÑà´Ã‘ZÌ2ÕPñ¸w]8iÇc|Èc][:Ü5#œhŽMO=œ1•¸FÐé»ním'hÀY­Ç¼=µNjÿ ‚m~ªÝAÁW˪Ɠ1m ÔE€.a’6·*ÿó@ÄÓŽÄfÐËÈŽHóBV ÙÂ(uI­R4õJ:×2´f‡së¹o²±LH-ÅlÎlÌÞ¶ì¿æ6½YðhñäJV(mr_2b@ 8¾ U¦i—Çv”VKÀi/L¶ÌØŽñWÿó@ÄÐŠÈ {M€åkƒm–Šy`°=€(*(GêëyŠý®•²_ n5ÛRH– Ô†î6s÷þ}><ø‡¸lì½µï<ÏËLjˆ(ó‹”Bv–:ö1Û°6`.GÏ©ÿó@ÄÑŠÄ~@Þ U:¼‘Ÿñ• `,ˆJ‘å¤bm}›j¤ƒìN$à¤éä †_¯â—Åxe] ©[ÊÚ°«­¤…D#@Ñ%Їÿó@ÄαVÌ{ñš0î˜J&…K!¥PE± ãAqÑVޱleLKIÍ´/¨&ÖhÙY‹æGˆŒDáA“š²™ÿg[´³°Äý·1‚hä"Á%}˜‘“ ¼„ 2ªL†Ëê$ˆ%•ÿó@ÄÎé.ÐcØÁÀYP€óÖE'‰ŸƒÂuÚR€j¸²z¤ÂAe/•¦Ÿ%$‰TÎ[6iô¬¬ƒ(£A,p‡ÿ=¾(­˜Þ”è ÀgÙk©?2Óbj ,S݉ ^BCÿó@ÄÍÁêÀzFd7‚2(Á bG4 r'‘‡…¤¡fîe“ ø:—ÀðÒI 3<ÙlŠé£8/_ìöóP{š [àSð<  [xíƒ^tQ¿CFŽ ©• H9ä¢ÿó@ÄÑ)r¸{ ]HTHX„²T\Aa8‚#  e!h$š>y~­²×ë}q µs§z„Áv17ý¼­ñçŸÕ<Þ‹mO  ²%‘jd·6´å"NdÂG@ኞ_6^eôäcÄ6ÿó@ÄÏ12ÍLÂLyŠÆÊ쩳³a‚¢Ú¡aðü•V|.³Öå>í;WzØýBeÆé÷nÄ Ú¾'ò92Î…yŸó:üÜÀý€%ù4#®ØÐu ’æ„ÑÚ* ¶ÀPTMÅP:L°ÿó@ÄÑ"Ð N%JbVXtc¾a|©tM‹©ÂX-mDH"FCàD‹fÊϪÜô‰êT‘B6Ã)2‰;Û·€4¨Nº£­²~¦¼ÌS.!Ÿ}Yƒ„®e®¤QŒ4t¤JgâK%[Tÿó@ÄÖ6È~˜Mƒš‘¢!j|¨b&/;óÕ¤RðÁ#bJeIãÀÑÆ¥áÌ«-÷¹Içêøåmá4†e, …ïþö"GÜŸƒÿ¼Å±Ú"^€Ø!¹­¾ü¹25€1Ô’B²ZªÔã³6Hÿó@ÄÓ:¼ÓÒĉ‹•Ÿ’í.#1:)?ÃqH œ›R#±ê0¨VhH½ºÄ”=\åNÊ>Š“’džÚâ§o•¡ð‘bçº_íL[°’’NÈösÈ® qµš6-yñ]¬ÿó@ÄÒ9"¼ Ó ÉeåAGQ—®Ej]vrÆÄßzá4æ©=Ð…Põj©¬”LªeH aóœ¨)ÊËšþ_ô•Y¡Œñsª¦Ñ…ê ÂJp#Òÿ ’ ¿I‘™ß¦ü)›™ì šl«ÿó@ÄÐ~°Þp †ïQhW’e 'Rì{aéê´¨XÒéÈ•Ó}0’oê<"nÆ?õî›+_-*7 bÒìéÈ¯Šœ¨ú¶Ç¾ÂüHíø$%}(ׄR4ÇM%ÈÅCL¤0é@ÒÒÿó@ÄÍÁ†°ÒRÜ” —LdÖia¤òin÷3«ð A{*„9ys´ó–kÔ'EͬĀ´§)•®Í›?Åsîõøuš=ƒžBiö|¾(Ah)¨‰õiX`¨¦4åð*øhd$ ñ/ÿó@ÄÑi*˜ÖÌUlÓœ´Â–®+Ëž¡=qm5çy,{ 4U€Š1ÓutÙ3¥3TÓFp”ö~Ð k3fЕF8±”­úÛnh»¶+rtB·/÷°³_¿/·ÿó@ÄÎùf”ØÍ mûÊ÷CÔkÂæÌ†Dlž™C:E‡!!@¶ÀHІÐb8lÍòB†×®'•E”„ìÍzð}á÷·{Äç¯_¶¦5|D4qŸì0†qÑYÚÜÕ'—ÿó@ÄÍqÂŒËÉ30\+;:HµÁ2ãêI”u3$ú0ÿ/“ѲÕY“(ò:UÇ‘ÈiÁg bH¹³¨alî%*jµ)Ì7•ã-©Gµ¡EÕÕ aœ¤Z†Àªð•LbBb5¹ËABÿó@ÄÎÁJÌ|cÙüË;/‰GÚ94.|”fDøùl”Øsgˆ‚@ÀZ#04pµº9NyûØَMuŠû~»,’šnÏÖqÿáÎñKx° &LÊB1`MPI&å®qÿó@ÄÎARÜø{p„Æ“l&ýÖPõlõpfGN!Ä®jËCtÁË$Mt²Fkik«U$_ÔË#³=,+Øî.+èt̺‘-~Ïžwï)¼×S $1AŽxt°ºÐÊr§ì]l­ÿó@ÄÌ)&Ì ÃÉc+ã%Ò€HGVŋމê–h˜LGçªjR%´ ÓqD-¬8kþ ³FV…HÅÇLds¥›”‚ƒŒ»ÅÌg_a:BÜ ÿY‰ Áf~õ‡êÚôÝÜSd¦€< E:#NVœÏ2 CM"…‘ÿó@ÄÏN¬Ó‘ l,¹U°j&cÎHÓsaÖ†/hx™‘tH„¤Ñ_8›l™9ÃZ7T Q¤’æÁ±œ­oPæ¯{¼Ï8‘W½Ò{0‘/oçoðªX  2†‹ YœÐ4 <Ƈ›.ÿó@ÄÌqR¨ÒF‘r êØÔG¦,-*–ÃÆˆ8±Hhu<„ŠY˜}Óî\<´¾ZùÎkŸPÊh‡‰|u3šSæ÷ÓF~ÏZóÖ×Îxˆ Yrƒ©‡±*€<ÃCÅÿó@ÄÍñj¤ ÒL‘Lz˹04Ĉ¹f #ˆ&¡J’Õ vW@½‚uê‚66ØåS¡‡Ã+3+C0Õ)X pbÞ½Ýñ|wД,Î` nâh˜ÙB¤5t#&78:ãC¨4ÀÀ1ÿÿó@ÄÌ©R¨ ÛÌi} ¸fºø{5s½µ.Ï0@£S4òÁèFÔj"F‚‚5*#^Q $xÓBÚBVÃ’Ó•ƒ(_Ä]Et«H ŠL5¿[úM@ Œ‚ ä:О,šµäï¼nÿó@Ä̱j¨TÞI/£Æº'csw÷¥í áŽZB¸D䛽pÜH%JŠ'4b ¦÷³41÷FSQt6í::ŠÕâ*0˜K³×1b@‘–ˆcÈ#xÔãs8äºS5^Ñfrÿó@ÄÐÁÞÆÆèËa¬Ô v-67Ô"yNFŒ'ÖTg +àñDó„—CV0„‚ؘ;¶…Uï«#ÉúEg‰MÕŒ\äWlS™†®((¤¡´7²nQ:V V`T-9÷‹ƒxÓy¬Èd™@𵽡}Ž2®î+n!ÓŒÄÌ5’¯¬_–¶eá4ïnc25&P¤ƒˆb¨Ë|ìº,é&´6(ÿó@ÄÏiþˆц­Â%@Yá6¥œ/-$P”8‰9C2fw“™ÑSÑ“Ê1C {<ŸUeFý¼üÈòìïy{yiæÃU˜„ª1Í·p¢@%(”¨ nŒ „"7wH·T‹Ú»ãKÎÿó@ÄÏB „Ë T:U7NX+D˜ôåüª2!߀ýD,ê‚ ] GPœ]V9Òmqc¢"ÇqäÍ+™;2Y³C3´¾*`×Ï×0¨@a˜Gr|(ÊP 4$ŸV¸L)DaRKHÿó@ÄÍö„ɆÙÅIÑÂEÎÀl¤‰ It¶d ÄàŽ¦O¦jZ²¥ƒ8ˆ²”ÒjˆE®ŸüÌç˜×’\ž¢_j>kNaÒëv—F ´Ù™Ë(yøÒÁˆ‰¨:ªXuLåQÿó@ÄÎi–„ËU[7,E‡‚%B±ÈãÝ‹T4»)Ê#CêÙ „p×P§ÍᔌÒ„^ä’d¹wjºfç ùGU£ç«ò}øUËl œT††‹‰`šÎ†©É±”Dâ lã¨%ÿó@ÄÓò„ÚLq„cà.D6Ц¿ê3#ê]Ѹê% H—!PJ*M„P˜R=(Bñ"qÃ¥yeÀK“ †E½É ÑÖ­hbPe ÆÉq°~ek‰%2ËK"Häæÿó@ÄÎiªÙ†µJbŽÊ‰ƒPðƒl£öO£fL&wH‘zÍÓ4qŽ&ùjª{™zÍ’Øù8j(—¡|?ÉgEưHŠÝKä q ºÐ  À:˜`©ù ¹B`ð€ÿó@ÄÓAR¼|à œ’mP´ª˜h„‰ÆÂþèbñÄ ‚hÁœY‡­€áªU_XæÄ Ä–Å,>.;´7%!ÃÃŲšßÀ!´!ûB„ut Ði“B˜{Áï­ x$DÀD ÌÉhÃÅTÊÿó@ÄÍAš¤ÞŒ_o4ÃhýDVp¦Z›ÃvÙ4ý#„È_ôÕ˜è“)L-ŽÆ0jÒ¥zçÔ-XÌ‚ÍÕ¥­Íœ;ü%äØxÉ¿À  "P´åDÖà²]¸_ðÿó@ÄϹbÛÆQTä.úhp$õ5–¬bñI©Æ|P l2AÎLWMLÂ`BŽ sŒ©Oå¬IgWχÐæÚÎY÷ºgztiø j‘&01)ÿ`.]…2‘IË5ÿó@ÄÏV” [É·ä#0‡aá0Ë\êWmkVƒ§]ö·J#@Jw ‰¯]jŽ׋M J÷ENÅÏuœ³€ù?4@ËÖ±F!|4ö0Ûç”x¹¡ˆâ!eû×›ŽAÀ)bÑâ°Üÿó@ÄÐA"Ù¿˜xmõeq¨bQnYÊNSÕíº–3ïxˆR pan‚¯  Æn–”:ð!‘¸2âmÞ¿Kÿ÷6 f–>L€|¡3ªÿÿöŸtÇ~÷bg@#Áªÿó@Ä€Âá˜`ŒÈ$/ˆ¢9Ìõ$”T3­Î¨Yƒðªo´Êu‹ ¯Þ•ЊÊ3QÆgÁAv™4vÓBáÕÓ­¯ZTßÐ… %©MêZâ£ÿMɸ#hº8EiØË¶ÿó@ÄÃAªä_Ø–$êh  Bv‹^»räs"sL% bår"‹²lù!DÕÌñ/á(:*} #ÄP|$e¯  {ûQ¾”ú…—aä§;ÿ7 àFxËæ‰rF\äŠ5Ùÿó@ÄÅ>Ø6ËR32×%SNh­æ¦#…iy5_cûL(Æ‘ÇDè쀅pjT>,hˆœù½Èp£,¬\%†~†=Hcüe$ÂhåÿV˜ )ãu‚ 2,øtȵœ[q tþ;ÿó@ÄÈAVà>ÂFJÅ9*;š+¶S­®Y…›°Q¢‰„Ï“XId¦ÉZ‰b um²IŒd‰F‡ƒÁ’s# (ƒž÷¿ÿÿW¿ù¸iÜ BÑøè&Í¡[ º•|iEÿó@ÄÎFà6y†ŽàB.¶é½U¾¿æF¯Yˆ©Ì¤ ñ9´â’ÜèŸ 5 06 ¯*¤0ÖxÁŠYÒPÑç Œ[zŒÊ T®n0ó ZàõÓæuÛ©äO5ÐD²t˜Ù–ÿó@ÄÏZÌÃÆnŸÜ”·ŸÁªÆÈ—g)Ó£Îц(ÆJ´Çm¤ORUY¬Ý-€RqÒW°Tð¨ºÔ,ÁœÜ›?H`sÞJÇi– ‡*äÿ“ŽMÀ˜kj‰kº0Üì>̇¨ìæ<óÿó@ÄÐA&äV{Ìû¨dBDRJYë”H3±˜µ©©î ž†#(1Zz¨ uÏ}§©gÙ’<2§©"X}ÿfÿC0kúM˜s© KH/=šHÓ\€1o‚0ãQ¨NÓ3\ÿó@ÄÒ6Ø6à n¼µöS£Ô΢¤Lóá‡"ÌžLê±4!Suæ<36Ý»o¥Î¶™éD·)ßç{âfSÊ8ýÿèrA­Ã‘ ‚ªŽBP9$¼Zêóêÿó@ÄÐ銤ÒF©Úî0lcÓtn̲4P€Y¥žXz@©–æÔŠLµ5ÚáÕÍd2U"¡fiœ›»f,‹òs„¾®-½¸E,©?å.T Ñ £!gqÙŠ!0L†,<î*§Vÿó@ÄÏ)V”ÞŒ5UÕB´˜4¦Aý¸¹Tá³ÒéÈ“é M ñ([J²‚f!$¬f-:ì&œx{™i]é~šläP¾pÔÝ$à°ͤÓJÊFëœ ¦ aB$E2Ëä¦/ÿó@ÄÍ1Z˜æ—M»ÑùÁƨ1€è9в¾;ƺòo~Ř„t“Ê@ób`ø&™WG¥¹y·…¸:À$^X6)R¶A~Ãö›%@ pˆÕ‰¯!±Ÿ©Q¸óJZ°ÄºB…íPZÿó@ÄÏyªÛF®óÉ‚¨‰ÄcYèH ÓZCóÑÚ©rµ´G¹Rn>‘aÿó@ÄÐqúˆÚF‘·c•Ä2i ö‰‹,½‘½ 'ýÐ `Û֫mU†mîj$TR`Á ª‹†T©´áé”']uHyý˜Hü°Â¬.‹+¥W»ôn‘ÙMz¶È'‘ÿó@ÄÍ‚ˆÚF‘áWBG¢Ì;ª÷Ù÷–û-s[¬Ukœw2Ä0¢ñÀñ… -E‹1nJñ…‚ â˜`q –W»A.¸Š|É ")@ÅÒ2?8Lp„š2¤Ó%-ß¶¢åZ~â¯Ëÿó@ÄαΈËY¿)áŠîÄjÔNŽÄ@òdåé<Ä”åcÇeF)5ß.Ÿ&ѽ1ta`$þxŠ.Ð9’žàÏ”`Õ¢õW,à°m]H¼…A‚ä…¹ô2& ï@øE‚Pâ$¯ÿó@Ä΄˔F~h=$e˜ú£çÁ$î.{­D™–êlEÚ¡’”snjžÎåë] Í÷ ‚÷1³“”]÷;\1Õö"Ï,>É#Kx"”"¡¶$ȨÃù<-­Èf#$ÿó@ÄͱքцÕ_‰ˆÌh…¢î ‘Ç`eœaj8¡Ó$‘¦¥8kX:j;\Ûòø—–€Fñsr V»ÇŒ ãUðGeÉ€(:`dÃ_:«™2×høG ŸEŽÿó@ÄÍiî„Ë M,wÆì”O]'ò*FëU°d!¡ÃÌ#5xÜ · MGqk"¼hš¶.f™&_vÈÚU6ÌÄ+¸‡DfSV¼”9eæÉJŸÕT¬®yTR$íMÄkÉ,Æÿó@ÄÎÁþ„ɆÐç£ÐWËçkš ‚ ³lŠšSPG mØ»³!—fbïw'Cr W½o¦RøŒÞ PÀL‡.qlvCátµ/—[Ž]!¯>ïüÙ;.cWšïÿó°ó‡Ù0~ëk¶Ã?ÿûäü.n4×y ÿó@ÄéRâYÏx/®Û˜¤Ôxò˜×¦`5¤d&ÖÄ ÚŒhõ@·‰áV(ƒÝm>þ}Wx•±ŽF×Ëg! „0(+lëî:CŽØ‡šfšÒ±‘æÙÐä4þ,ü§Ïñë8Dgv¨úÿó@ÄNÙl6lÐÀ ÜÊ:œËnä4@ƒ3 »VjԦüº{­S¤¡òÿkT17kw:I(S{æ—8µéIßmcŒX? FÓ#ö:éÿÿ6%„E?V@!cZ(  Ð£Pÿó@Ä ÁRÑê6ˆýó”¸B㣫WYcˆè CG7ØÄßûèÒ¦â)ªÖßê ÃûÝ-ìù°þ÷Ëš€%@Ž\¹þÖ÷ò‚‚î" !Ê¥à{R–²‹Þ\›N³³úílÙÒ%3ÿó@ÄANÉðNÖsÇ]°_ÿWÃÇMâãÌãë©¡e+]Ü´4=?nz P~,]…A— }™^>@E_ûP*Æ9Yäƒxm̯­>³}ÊACÔ2u-!/†MºLˆ0Ådá’VWÿó@Ä*ª"áþzD±?˜„ëPE'ÌX禂%Žf–ÿ­.ÕUµ¦k›ù’Šz™†?’xº–*PtŽ+\`áÝóÖ4°ODp1JÖùD®,ç:^ÈÁ5/DåˆÑqþ’LØ©GX¥òÿó@Ä6NÕücÆÔ­©0Ü¡f(lyÐX÷öcAäzê+蔦Ù\Ù]UÈ’»¥/>ß TÁÁÓß#%KVD(^7‚&ÝìÈ0#;úí8*†+Ԛбch¾ 6J}ë" b¾G?ðÿó@Ä[>ÑôKÐt‡0g÷ŒÚÍ,,ƒMHž Q4Ÿ?Hq×PQDŸÞÑèÀð?wÔT@2~ ­Óîh]ßö(ÅÚƒþxøµ Géw%ëB.$¯â^39³%¨å&‰ ½Aغ?ÿ×P–(4yÿ¹ ÿó@Ä jÉà6„  R¨˜ÉDgÂãŽk[¢ÏDC½þÞÇœ|+-cÆÞ·¿;SúR-«Oµª~ØÂu9{ÝÔR¦ZßP®{Ógÿœ Ûƒ“?¶°@€30ÿó@ħfÑâ4tˆt ö0Øyƒþ„¥òfž‚€xîú­Ú½J0ÉÈSɾ>º„$¸ž5ášµÛ,U•dä l[»·±Ý*"žh™¢â/Ú,aâVÖžÍm¢ä‡juÿó@ĸbÍä6€n´O•LÀrûÜW‰Ê¦Xþ™šö¬$!­w›y›~Ù–alKÌVÕ·¶³TnÅé“ùW5ÙûË8T,¿JÄz”ƒ_–€"[=~ãõ"½•%]ò^Ø Ò©¾×¶ÿó@ÄÁÁVÖ3Rd–¢Èá%!@ Ž«i3½›]æÖŸ™W;:ö1:TÛÞáóÖÚ!¡>íZVÄÒ™ŸõºÕ×Uky¬VKV^%!/€„¬²JI6I1䈇—U|8Ìè«ÿó@ÄÉA^ÍðN€B¸©ÃA *UÕyÅÖÙÅ•-%v׎‹žzr¶­vìzÒÞ¶Ú»@ïobLu§ú*µcáVNØ6;Ž­Âr!2"’v™l˜3'-X‹­^)4©wÅÿó@ÄÏÂ2Åôü.ª¤±{S"L˜à”e„ RÙÊzœ»1>Ýð«<×"õL¬¦™¸¬ê/'é!õÿ'îßlîÉZ-ââ¡«½ÚzÓ,ÔvÖæñ¥»A$;F†•<2W™ý³rnRÿó@ÄÏ^¹èN˜h€Á © 0LÔ\ŒŒi-Amf-70•KÏÌt,‰¨dÛsÅ¢úuF¹¼ Õò§ëüwvôUÇ‘Ð&™l{ÛQÁjØ…ÿèÃPჺ ¥NˆðÈ.û‚Õ¨rÝ iÿó@ÄÐyb±@NŒQ‚ ‰=ö²¬‚̓“b¡% ’á8¡"éд•U6k½feÞÌæy•±ÐÊšŸÙ_;MˆË_9•£y¬s7% FŽ—mÉA“«U~ËZ[«I©·Ð¸h4Rèÿó@ÄÑ’­@ÒLå­êºñi°µC‚%ÙV¶PS.Õ8Ä×0Óò ASAbaã|ð¢c@B i"ãwófÙãQ£ÿó@ÄÕ:2œÁ†ÕN1hœz bÑ8¸Z'2æŸ4â–‰Ï 8¥¢sÆ¢s*©)I-o+*"R’X&„²¢«*–+BXh‰JKMÙ»;›ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿó@ÄÓ‚FœÖa†lÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿó@ÄÐJXzLÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿó@ÄÑ @[ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿó@ÄÿÀ[ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿó@ÄÿÀ[ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿó@ÄÿÀ[ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿalmond-0.2.9/tests/doh/runner.html000066400000000000000000000174501226333677700171360ustar00rootroot00000000000000 almond Tests Via The Dojo Unit Test Harness, $Rev: 20149 $

almond Tests Via D.O.H.: The Dojo Objective Harness

Stopped
  test time

							
almond-0.2.9/tests/doh/runner.js000066400000000000000000001301751226333677700166060ustar00rootroot00000000000000// package system gunk. //try{ // dojo.provide("doh.runner"); //}catch(e){ if(!this["doh"]){ doh = {}; } //} // // Utility Functions and Classes // doh.selfTest = false; doh.global = this; doh.hitch = function(/*Object*/thisObject, /*Function|String*/method /*, ...*/){ var args = []; for(var x=2; x= 0)) { this._fire(); } }, _continue: function(res){ this._resback(res); this._unpause(); }, _resback: function(res){ this.fired = ((res instanceof Error) ? 1 : 0); this.results[this.fired] = res; this._fire(); }, _check: function(){ if(this.fired != -1){ if(!this.silentlyCancelled){ throw new Error("already called!"); } this.silentlyCancelled = false; return; } }, callback: function(res){ this._check(); this._resback(res); }, errback: function(res){ this._check(); if(!(res instanceof Error)){ res = new Error(res); } this._resback(res); }, addBoth: function(cb, cbfn){ var enclosed = this.getFunctionFromArgs(cb, cbfn); if(arguments.length > 2){ enclosed = doh.hitch(null, enclosed, arguments, 2); } return this.addCallbacks(enclosed, enclosed); }, addCallback: function(cb, cbfn){ var enclosed = this.getFunctionFromArgs(cb, cbfn); if(arguments.length > 2){ enclosed = doh.hitch(null, enclosed, arguments, 2); } return this.addCallbacks(enclosed, null); }, addErrback: function(cb, cbfn){ var enclosed = this.getFunctionFromArgs(cb, cbfn); if(arguments.length > 2){ enclosed = doh.hitch(null, enclosed, arguments, 2); } return this.addCallbacks(null, enclosed); }, addCallbacks: function(cb, eb){ this.chain.push([cb, eb]); if(this.fired >= 0){ this._fire(); } return this; }, _fire: function(){ var chain = this.chain; var fired = this.fired; var res = this.results[fired]; var self = this; var cb = null; while(chain.length > 0 && this.paused == 0){ // Array var pair = chain.shift(); var f = pair[fired]; if(f == null){ continue; } try { res = f(res); fired = ((res instanceof Error) ? 1 : 0); if(res instanceof doh.Deferred){ cb = function(res){ self._continue(res); }; this._pause(); } }catch(err){ fired = 1; res = err; } } this.fired = fired; this.results[fired] = res; if((cb)&&(this.paused)){ res.addBoth(cb); } } }); // // State Keeping and Reporting // doh._testCount = 0; doh._groupCount = 0; doh._errorCount = 0; doh._failureCount = 0; doh._currentGroup = null; doh._currentTest = null; doh._paused = true; doh._init = function(){ this._currentGroup = null; this._currentTest = null; this._errorCount = 0; this._failureCount = 0; this.debug(this._testCount, "tests to run in", this._groupCount, "groups"); } // doh._urls = []; doh._groups = {}; // // Test Registration // doh.registerTestNs = function(/*String*/ group, /*Object*/ ns){ // summary: // adds the passed namespace object to the list of objects to be // searched for test groups. Only "public" functions (not prefixed // with "_") will be added as tests to be run. If you'd like to use // fixtures (setUp(), tearDown(), and runTest()), please use // registerTest() or registerTests(). for(var x in ns){ if( (x.charAt(0) != "_") && (typeof ns[x] == "function") ){ this.registerTest(group, ns[x]); } } } doh._testRegistered = function(group, fixture){ // slot to be filled in } doh._groupStarted = function(group){ // slot to be filled in } doh._groupFinished = function(group, success){ // slot to be filled in } doh._testStarted = function(group, fixture){ // slot to be filled in } doh._testFinished = function(group, fixture, success){ // slot to be filled in } doh.registerGroup = function( /*String*/ group, /*Array||Function||Object*/ tests, /*Function*/ setUp, /*Function*/ tearDown, /*String*/ type){ // summary: // registers an entire group of tests at once and provides a setUp and // tearDown facility for groups. If you call this method with only // setUp and tearDown parameters, they will replace previously // installed setUp or tearDown functions for the group with the new // methods. // group: // string name of the group // tests: // either a function or an object or an array of functions/objects. If // an object, it must contain at *least* a "runTest" method, and may // also contain "setUp" and "tearDown" methods. These will be invoked // on either side of the "runTest" method (respectively) when the test // is run. If an array, it must contain objects matching the above // description or test functions. // setUp: a function for initializing the test group // tearDown: a function for initializing the test group // type: The type of tests these are, such as a group of performance tests // null/undefied are standard DOH tests, the valye 'perf' enables // registering them as performance tests. if(tests){ this.register(group, tests, type); } if(setUp){ this._groups[group].setUp = setUp; } if(tearDown){ this._groups[group].tearDown = tearDown; } } doh._getTestObj = function(group, test, type){ var tObj = test; if(typeof test == "string"){ if(test.substr(0, 4)=="url:"){ return this.registerUrl(group, test); }else{ tObj = { name: test.replace("/\s/g", "_") // FIXME: bad escapement }; tObj.runTest = new Function("t", test); } }else if(typeof test == "function"){ // if we didn't get a fixture, wrap the function tObj = { "runTest": test }; if(test["name"]){ tObj.name = test.name; }else{ try{ var fStr = "function "; var ts = tObj.runTest+""; if(0 <= ts.indexOf(fStr)){ tObj.name = ts.split(fStr)[1].split("(", 1)[0]; } // doh.debug(tObj.runTest.toSource()); }catch(e){ } } // FIXME: try harder to get the test name here } //Augment the test with some specific options to make it identifiable as a //particular type of test so it can be executed properly. if(type === "perf" || tObj.testType === "perf"){ tObj.testType = "perf"; //Build an object on the root DOH class to contain all the test results. //Cache it on the test object for quick lookup later for results storage. if(!doh.perfTestResults){ doh.perfTestResults = {}; doh.perfTestResults[group] = {}; } if(!doh.perfTestResults[group]){ doh.perfTestResults[group] = {}; } if(!doh.perfTestResults[group][tObj.name]){ doh.perfTestResults[group][tObj.name] = {}; } tObj.results = doh.perfTestResults[group][tObj.name]; //If it's not set, then set the trial duration //default to 100ms. if(!("trialDuration" in tObj)){ tObj.trialDuration = 100; } //If it's not set, then set the delay between trial runs to 100ms //default to 100ms to allow for GC and to make IE happy. if(!("trialDelay" in tObj)){ tObj.trialDelay = 100; } //If it's not set, then set number of times a trial is run to 10. if(!("trialIterations" in tObj)){ tObj.trialIterations = 10; } } return tObj; } doh.registerTest = function(/*String*/ group, /*Function||Object*/ test, /*String*/ type){ // summary: // add the provided test function or fixture object to the specified // test group. // group: // string name of the group to add the test to // test: // either a function or an object. If an object, it must contain at // *least* a "runTest" method, and may also contain "setUp" and // "tearDown" methods. These will be invoked on either side of the // "runTest" method (respectively) when the test is run. // type: // An identifier denoting the type of testing that the test performs, such // as a performance test. If null, defaults to regular DOH test. if(!this._groups[group]){ this._groupCount++; this._groups[group] = []; this._groups[group].inFlight = 0; } var tObj = this._getTestObj(group, test, type); if(!tObj){ return null; } this._groups[group].push(tObj); this._testCount++; this._testRegistered(group, tObj); return tObj; } doh.registerTests = function(/*String*/ group, /*Array*/ testArr, /*String*/ type){ // summary: // registers a group of tests, treating each element of testArr as // though it were being (along with group) passed to the registerTest // method. It also uses the type to decide how the tests should // behave, by defining the type of tests these are, such as performance tests for(var x=0; x 1) ? "s" : "")+" to run"); } doh._handleFailure = function(groupName, fixture, e){ // this.debug("FAILED test:", fixture.name); // mostly borrowed from JUM this._groups[groupName].failures++; var out = ""; if(e instanceof this._AssertFailure){ this._failureCount++; if(e["fileName"]){ out += e.fileName + ':'; } if(e["lineNumber"]){ out += e.lineNumber + ' '; } out += e+": "+e.message; this.debug("\t_AssertFailure:", out); }else{ this._errorCount++; } this.debug(e); if(fixture.runTest["toSource"]){ var ss = fixture.runTest.toSource(); this.debug("\tERROR IN:\n\t\t", ss); }else{ this.debug("\tERROR IN:\n\t\t", fixture.runTest); } if(e.rhinoException){ e.rhinoException.printStackTrace(); }else if(e.javaException){ e.javaException.printStackTrace(); } } //Assume a setTimeout implementation that is synchronous, so that //the Node and Rhino envs work similar to each other. Node defines //a setTimeout, so testing for setTimeout is not enough, each environment //adapter should set this value accordingly. doh.setTimeout = function(func){ return func(); }; doh._runPerfFixture = function(/*String*/groupName, /*Object*/fixture){ // summary: // This function handles how to execute a 'performance' test // which is different from a straight UT style test. These // will often do numerous iterations of the same operation and // gather execution statistics about it, like max, min, average, // etc. It makes use of the already in place DOH deferred test // handling since it is a good idea to put a pause inbetween each // iteration to allow for GC cleanup and the like. // // groupName: // The test group that contains this performance test. // fixture: // The performance test fixture. var tg = this._groups[groupName]; fixture.startTime = new Date(); //Perf tests always need to act in an async manner as there is a //number of iterations to flow through. var def = new doh.Deferred(); tg.inFlight++; def.groupName = groupName; def.fixture = fixture; def.addErrback(function(err){ doh._handleFailure(groupName, fixture, err); }); //Set up the finalizer. var retEnd = function(){ if(fixture["tearDown"]){ fixture.tearDown(doh); } tg.inFlight--; if((!tg.inFlight)&&(tg.iterated)){ doh._groupFinished(groupName, !tg.failures); } doh._testFinished(groupName, fixture, def.results[0]); if(doh._paused){ doh.run(); } }; //Since these can take who knows how long, we don't want to timeout //unless explicitly set var timer; var to = fixture.timeout; if(to > 0) { timer = doh.setTimeout(function(){ // ret.cancel(); // retEnd(); def.errback(new Error("test timeout in "+fixture.name.toString())); }, to); } //Set up the end calls to the test into the deferred we'll return. def.addBoth(function(arg){ if(timer){ clearTimeout(timer); } retEnd(); }); //Okay, now set up the timing loop for the actual test. //This is down as an async type test where there is a delay //between each execution to allow for GC time, etc, so the GC //has less impact on the tests. var res = fixture.results; res.trials = []; //Try to figure out how many calls are needed to hit a particular threshold. var itrDef = doh._calcTrialIterations(groupName, fixture); itrDef.addErrback(function(err){ fixture.endTime = new Date(); def.errback(err); }); //Blah, since tests can be deferred, the actual run has to be deferred until after //we know how many iterations to run. This is just plain ugly. itrDef.addCallback(function(iterations){ if(iterations){ var countdown = fixture.trialIterations; doh.debug("TIMING TEST: [" + fixture.name + "]\n\t\tITERATIONS PER TRIAL: " + iterations + "\n\tTRIALS: " + countdown); //Figure out how many times we want to run our 'trial'. //Where each trial consists of 'iterations' of the test. var trialRunner = function() { //Set up our function to execute a block of tests var start = new Date(); var tTimer = new doh.Deferred(); var tCountdown = iterations; var tState = { countdown: iterations }; var testRunner = function(state){ while(state){ try{ state.countdown--; if(state.countdown){ var ret = fixture.runTest(doh); if(ret instanceof doh.Deferred){ //Deferreds have to be handled async, //otherwise we just keep looping. var atState = { countdown: state.countdown }; ret.addCallback(function(){ testRunner(atState); }); ret.addErrback(function(err) { doh._handleFailure(groupName, fixture, err); fixture.endTime = new Date(); def.errback(err); }); state = null; } }else{ tTimer.callback(new Date()); state = null; } }catch(err){ fixture.endTime = new Date(); tTimer.errback(err); } } }; tTimer.addCallback(function(end){ //Figure out the results and try to factor out function call costs. var tResults = { trial: (fixture.trialIterations - countdown), testIterations: iterations, executionTime: (end.getTime() - start.getTime()), average: (end.getTime() - start.getTime())/iterations }; res.trials.push(tResults); doh.debug("\n\t\tTRIAL #: " + tResults.trial + "\n\tTIME: " + tResults.executionTime + "ms.\n\tAVG TEST TIME: " + (tResults.executionTime/tResults.testIterations) + "ms."); //Okay, have we run all the trials yet? countdown--; if(countdown){ doh.setTimeout(trialRunner, fixture.trialDelay); }else{ //Okay, we're done, lets compute some final performance results. var t = res.trials; //We're done. fixture.endTime = new Date(); def.callback(true); } }); tTimer.addErrback(function(err){ fixture.endTime = new Date(); def.errback(err); }); testRunner(tState); }; trialRunner(); } }); //Set for a pause, returned the deferred. if(def.fired < 0){ doh.pause(); } return def; }; doh._calcTrialIterations = function(/*String*/ groupName, /*Object*/ fixture){ // summary: // This function determines the rough number of iterations to // use to reach a particular MS threshold. This returns a deferred // since tests can theoretically by async. Async tests aren't going to // give great perf #s, though. // The callback is passed the # of iterations to hit the requested // threshold. // // fixture: // The test fixture we want to calculate iterations for. var def = new doh.Deferred(); var calibrate = function () { var testFunc = fixture.runTest; //Set the initial state. We have to do this as a loop instead //of a recursive function. Otherwise, it blows the call stack //on some browsers. var iState = { start: new Date(), curIter: 0, iterations: 5 }; var handleIteration = function(state){ while(state){ if(state.curIter < state.iterations){ try{ var ret = testFunc(doh); if(ret instanceof doh.Deferred){ var aState = { start: state.start, curIter: state.curIter + 1, iterations: state.iterations }; ret.addCallback(function(){ handleIteration(aState); }); ret.addErrback(function(err) { fixture.endTime = new Date(); def.errback(err); }); state = null; }else{ state.curIter++; } }catch(err){ fixture.endTime = new Date(); def.errback(err); return; } }else{ var end = new Date(); var totalTime = (end.getTime() - state.start.getTime()); if(totalTime < fixture.trialDuration){ var nState = { iterations: state.iterations * 2, curIter: 0 } state = null; doh.setTimeout(function(){ nState.start = new Date(); handleIteration(nState); }, 50); }else{ var itrs = state.iterations; doh.setTimeout(function(){def.callback(itrs)}, 50); state = null; } } } }; handleIteration(iState); }; doh.setTimeout(calibrate, 10); return def; }; doh._runRegFixture = function(/*String*/groupName, /*Object*/fixture){ // summary: // Function to run a generic doh test. These are not // specialized tests, like performance groups and such. // // groupName: // The groupName of the test. // fixture: // The test fixture to execute. var tg = this._groups[groupName]; fixture.startTime = new Date(); var ret = fixture.runTest(this); fixture.endTime = new Date(); // if we get a deferred back from the test runner, we know we're // gonna wait for an async result. It's up to the test code to trap // errors and give us an errback or callback. if(ret instanceof doh.Deferred){ tg.inFlight++; ret.groupName = groupName; ret.fixture = fixture; ret.addErrback(function(err){ doh._handleFailure(groupName, fixture, err); }); var retEnd = function(){ if(fixture["tearDown"]){ fixture.tearDown(doh); } tg.inFlight--; if((!tg.inFlight)&&(tg.iterated)){ doh._groupFinished(groupName, !tg.failures); } doh._testFinished(groupName, fixture, ret.results[0]); if(doh._paused){ doh.run(); } } var timer = doh.setTimeout(function(){ // ret.cancel(); // retEnd(); ret.errback(new Error("test timeout in "+fixture.name.toString())); }, fixture["timeout"]||1000); ret.addBoth(function(arg){ clearTimeout(timer); retEnd(); }); if(ret.fired < 0){ doh.pause(); } return ret; } }; doh._runFixture = function(groupName, fixture){ var tg = this._groups[groupName]; this._testStarted(groupName, fixture); var threw = false; var err = null; // run it, catching exceptions and reporting them try{ // let doh reference "this.group.thinger..." which can be set by // another test or group-level setUp function fixture.group = tg; // only execute the parts of the fixture we've got if(fixture["setUp"]){ fixture.setUp(this); } if(fixture["runTest"]){ // should we error out of a fixture doesn't have a runTest? if(fixture.testType === "perf"){ //Always async deferred, so return it. return doh._runPerfFixture(groupName, fixture); }else{ //May or may not by async. var ret = doh._runRegFixture(groupName, fixture); if(ret){ return ret; } } } if(fixture["tearDown"]){ fixture.tearDown(this); } }catch(e){ threw = true; err = e; if(!fixture.endTime){ fixture.endTime = new Date(); } } var d = new doh.Deferred(); doh.setTimeout(this.hitch(this, function(){ if(threw){ this._handleFailure(groupName, fixture, err); } this._testFinished(groupName, fixture, !threw); if((!tg.inFlight)&&(tg.iterated)){ doh._groupFinished(groupName, !tg.failures); }else if(tg.inFlight > 0){ doh.setTimeout(this.hitch(this, function(){ doh.runGroup(groupName); // , idx); }), 100); this._paused = true; } if(doh._paused){ doh.run(); } }), 30); doh.pause(); return d; } doh._testId = 0; doh.runGroup = function(/*String*/ groupName, /*Integer*/ idx){ // summary: // runs the specified test group // the general structure of the algorithm is to run through the group's // list of doh, checking before and after each of them to see if we're in // a paused state. This can be caused by the test returning a deferred or // the user hitting the pause button. In either case, we want to halt // execution of the test until something external to us restarts it. This // means we need to pickle off enough state to pick up where we left off. // FIXME: need to make fixture execution async!! var tg = this._groups[groupName]; if(tg.skip === true){ return; } if(this._isArray(tg)){ if(idx<=tg.length){ if((!tg.inFlight)&&(tg.iterated == true)){ if(tg["tearDown"]){ tg.tearDown(this); } doh._groupFinished(groupName, !tg.failures); return; } } if(!idx){ tg.inFlight = 0; tg.iterated = false; tg.failures = 0; } doh._groupStarted(groupName); if(!idx){ this._setupGroupForRun(groupName, idx); if(tg["setUp"]){ tg.setUp(this); } } for(var y=(idx||0); y"); } */ } } }catch(e){ print("\n"+doh._line); print("The Dojo Unit Test Harness, $Rev: 20389 $"); print("Copyright (c) 2009, The Dojo Foundation, All Rights Reserved"); print(doh._line, "\n"); try{ var dojoUrl = "../../dojo/dojo.js"; var testUrl = ""; var testModule = "dojo.tests.module"; var dohBase = ""; for(x=0; x}bcc$®ÿÿ"Ùõ <<<ƒÄõÿÿ"ÍõÌÌÌ ƒÄõÿÿ¢‡ëûûûÛÛÛ©îzÿÿb!ͯLLðôóçÏ¿wï¦JQQѼ¼<{ÆŒ?~œ>}zee%DdÚ´iÏŸ?ÇÔ%//Ÿ’’B¼{ÿÿ"ÍõŒŒŒ ȹVZZ!h€ŸŸÎŽŠŠêììŒŽŽ†‹ÈÉÉaÍ"rΟ¦9çY•ª’cœo9Ä{öÞ"ÀÝIš€Z+ÉÖ€RÊ»ëk­”€ÞûOýÿÿBO÷‡ºyó&C||<š¼ä™9s&ƒ§§'féÁÈÈ à¿ÿBò ¤œ5kCpp0¤ðEììì¾¾¾p5ÄÿÿB7âÀ """X›bÆÆÆÇýþýûرcp\*Ÿ?~ëÖ-ˆëYXXîß¿ÿðáC<ºLLL Æ—/_ˆq=ÿÿBw=$౪‡¸þùóçß¿g``‘‘Áª.~÷î]H…ÀÄÄtÿþ}4Y4 --ÍÀÀðóçϧOŸãzÿÿBw=ÄÓ¼¼¼Øë6XYùíÛ7W«®žH¾~ýŠ_\n>~ÿÿbª^´£÷ïßCÊxxZ‡ÄÖ~ <· ç2táÿÿBw½‚‚Ë/°ª¾qãÄõÜÜÜ ?ƪòÉ“'†ŠŠ ¼bQVV†°q邈srrB ‚ÿÿBw½••Ã;w°æ›ýû÷Cb†……ÅÖÖ–áôéÓXÍ…ˆËÉÉÁ]üçÏ999ˆgðë277‡ AÿÿBw½»»»ˆˆÈß¿ׯ_&uîܹ«W¯BÜÁÀÀ••ÅÀÀ°}ûö?bÖßÚ -- Þ†ƒèÊÌÌd``X½z5fâüöíÛ¦M›àjˆÿÿÂR×ö÷÷CŠ×¯_#7³¬­­KJJ¼¼¼ ‚QQQ ¹¹¹h&@ lSSÓoß¾ýû÷¯¦¦†!55R%ÙØØ000Lœ8MWii)¤*€7 ÿÿbÀÚîKOOg``PWW_²dÉÙ³gW¬Xajj:{öì  ·1¿}û–ÀÈÈwñâÅ>ܹs§²²’……ÅÑÑñÅ‹e×'&&B¸¯_¿vwwgff.))¹}ûö‡._¾œ’’ÂÈÈùåËâÛ9ÿÿÂÞJƒ¤wwwIIIiié   cÇŽýû÷ïàÁƒhÁvðàÁøøxuuuiii%%¥   µk×"·U ®…‹üþý{ãÆ¡¡¡ÊÊÊÒÒÒjjj111{÷î%>Ô!ÿÿ"о'É8\Š!®ŒŒÄÕÄÿG.ÿÿb"¦3ERÏ üþý›`o“<ÿÿ¢ÇH ¤ð%²$ ÿÿ¢‡ë!uŸ’’ÕMÿÿ¢¹ëÿýûwöìY&&&Hφºÿÿ¢¹ëwïÞýàÁƒØØX===ªÿÿbøG3póæÍ¾¾>qqñ¨¨(’Jqâÿÿb¡]¨üøñùóçëׯ‡ôiÿÿbÒóVÿÿÚs'ÿÿÚ®ÿÿÚ®ÿÿk«4B ˜IEND®B`‚almond-0.2.9/tests/emptyFactory/000077500000000000000000000000001226333677700166445ustar00rootroot00000000000000almond-0.2.9/tests/emptyFactory/emptyFactory.html000066400000000000000000000017011226333677700222170ustar00rootroot00000000000000 almond: Empty Factory Test

almond: Empty Factory Test

Module that has an empty factory function.

Check console for messages

almond-0.2.9/tests/emptyFactory/emptyFactory.js000066400000000000000000000011401226333677700216640ustar00rootroot00000000000000 define("bread", ['yeast'], function (yeast) { return { name: 'bread', ingredient: yeast }; }); //Test undefined exports. define("water", function () {}); define("bin", ['water'], function (water) { return { name: 'bin', water: water }; }); define("yeast", ['water', 'bin'], function(water, bin) { return { name: 'yeast', water: water, bin: bin }; }); //Using sync require, but callback-require([], function(){}) is suggested. //This form only used in some particular CommonJS module bundling. var bread = require('bread'); almond-0.2.9/tests/errback/000077500000000000000000000000001226333677700155675ustar00rootroot00000000000000almond-0.2.9/tests/errback/errback.html000066400000000000000000000063241226333677700200730ustar00rootroot00000000000000 almond: errback Test

almond: errback Test

Test the use of errbacks in a require call. While almond does not support calling an errback (all modules should be built in and usable), almond should not throw any errors if they are used.

Check console for messages

almond-0.2.9/tests/firstDefine/000077500000000000000000000000001226333677700164205ustar00rootroot00000000000000almond-0.2.9/tests/firstDefine/firstDefine.html000066400000000000000000000017401226333677700215520ustar00rootroot00000000000000 almond: First Define Test

almond: First Define Test

First define should win. More Info.

Check console for messages

almond-0.2.9/tests/hasOwnProperty/000077500000000000000000000000001226333677700171625ustar00rootroot00000000000000almond-0.2.9/tests/hasOwnProperty/hasOwnProperty.html000066400000000000000000000022461226333677700230600ustar00rootroot00000000000000 almond: hasOwnProperty Test

almond: hasOwnProperty Test

Check console for messages

almond-0.2.9/tests/index.html000066400000000000000000000003271226333677700161550ustar00rootroot00000000000000 almond tests

almond tests

  1. All Automated Tests
almond-0.2.9/tests/insertRequire/000077500000000000000000000000001226333677700170175ustar00rootroot00000000000000almond-0.2.9/tests/insertRequire/insertRequire.html000066400000000000000000000017741226333677700225570ustar00rootroot00000000000000 almond: insertRequire Test

almond: insertRequire Test

Make sure almond can handle juse a plain require(['a']) used by r.js's insertRequire build option. More info: 27.

Check console for messages

almond-0.2.9/tests/mapConfig/000077500000000000000000000000001226333677700160615ustar00rootroot00000000000000almond-0.2.9/tests/mapConfig/mapConfig.html000066400000000000000000000007351226333677700206570ustar00rootroot00000000000000 require.js: Map Config Test

require.js: Map Config Test

Test using the map config.

Check console for messages

almond-0.2.9/tests/mapConfig/mapConfig.js000066400000000000000000000025441226333677700203270ustar00rootroot00000000000000 define('c1',{ name: 'c1' }); define('c1/sub',{ name: 'c1/sub' }); define('a',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); define('c',{ name: 'c' }); define('c/sub',{ name: 'c/sub' }); define('b',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); define('c2',{ name: 'c2' }); define('c2/sub',{ name: 'c2/sub' }); define('a/sub/one',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); require({ baseUrl: './', paths: { a: 'a1' }, map: { 'a': { c: 'c1' }, 'a/sub/one': { 'c': 'c2' } } }, ['a', 'b', 'c', 'a/sub/one'], function(a, b, c, one) { doh.register( 'mapConfig', [ function mapConfig(t){ t.is('c1', a.c.name); t.is('c1/sub', a.csub.name); t.is('c2', one.c.name); t.is('c2/sub', one.csub.name); t.is('c', b.c.name); t.is('c/sub', b.csub.name); t.is('c', c.name); } ] ); doh.run(); } ); define("mapConfig-tests", function(){}); almond-0.2.9/tests/mapConfig/mapConfigPlugin.html000066400000000000000000000010251226333677700220270ustar00rootroot00000000000000 almond: Map Config Plugin Built Test

almond: Map Config Plugin Built Test

Test using the map config with plugin value after a build.

Check console for messages

almond-0.2.9/tests/mapConfig/mapConfigPlugin.js000066400000000000000000000035141226333677700215040ustar00rootroot00000000000000 define('plug',{ load: function (name, require, load, config) { if (!name) { name = 'main'; } else if (name.charAt(0) === '/') { name = 'main' + name; } //Only grab the first segment of the name. //This is just to be different, nothing //that is required behavior. name = name.split('/').shift(); name = 'plug/' + name; require([name], load); } }); define('plug/c1',{ name: 'plug!c1' }); define('a',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); define('plug/main',{ name: 'plug!main' }); define('b',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); define('plug/c2',{ name: 'plug!c2' }); define('a/sub/one',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); require({ baseUrl: './', paths: { a: 'a1' }, map: { '*': { c: 'plug!' }, 'a': { c: 'plug!c1' }, 'a/sub/one': { 'c': 'plug!c2' } } }, ['a', 'b', 'c', 'a/sub/one'], function(a, b, c, one) { doh.register( 'mapConfigPlugin', [ function mapConfigPlugin(t){ t.is('plug!c1', a.c.name); t.is('plug!c1', a.csub.name); t.is('plug!c2', one.c.name); t.is('plug!c2', one.csub.name); t.is('plug!main', b.c.name); t.is('plug!main', b.csub.name); t.is('plug!main', c.name); } ] ); doh.run(); } ); define("mapConfigPlugin-tests", function(){}); almond-0.2.9/tests/mapConfig/mapConfigSpecificity.html000066400000000000000000000011171226333677700230460ustar00rootroot00000000000000 require.js: Map Config Specificity Test

require.js: Map Config Specificity Test

Test map config specificity. More info.

Check console for messages

almond-0.2.9/tests/mapConfig/mapConfigSpecificity.js000066400000000000000000000015671226333677700225270ustar00rootroot00000000000000/*jslint sloppy: true */ /*global define, require, doh */ define('foo-1.0/bar/baz', [], function () { return '1.0'; }); define('foo-1.2/bar/baz', [], function () { return '1.2'; }); define('oldmodule', ['foo/bar/baz'], function (baz) { return { name: 'oldmodule', baz: baz }; }); require({ baseUrl: './', map: { 'oldmodule': { //This one should be favored over the * value. 'foo' : 'foo-1.0' }, '*': { 'foo/bar' : 'foo-1.2/bar' } } }, ['oldmodule'], function (oldmodule) { doh.register( 'mapConfigSpecificity', [ function mapConfigSpecificity(t) { t.is('oldmodule', oldmodule.name); t.is('1.0', oldmodule.baz); } ] ); doh.run(); }); almond-0.2.9/tests/mapConfig/mapConfigStar.html000066400000000000000000000007621226333677700215110ustar00rootroot00000000000000 require.js: Map Config Star Test

require.js: Map Config Star Test

Test using '*' in the map config.

Check console for messages

almond-0.2.9/tests/mapConfig/mapConfigStar.js000066400000000000000000000036641226333677700211650ustar00rootroot00000000000000 define('c1',{ name: 'c1' }); define('c1/sub',{ name: 'c1/sub' }); define('a',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); define('another/minor',{ name: 'another/minor' }); define('another/c',['./minor'], function (minor) { return { name: 'another/c', minorName: minor.name }; }); define('another/c/dim',{ name: 'another/c/dim' }); define('another/c/sub',['./dim'], function (dim) { return { name: 'another/c/sub', dimName: dim.name }; }); define('b',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); define('c2',{ name: 'c2' }); define('a/sub/one',['c', 'c/sub'], function (c, csub) { return { c: c, csub: csub }; }); require({ baseUrl: './', paths: { a: 'a1' }, map: { '*': { 'c': 'another/c' }, 'a': { c: 'c1' }, 'a/sub/one': { 'c': 'c2', 'c/sub': 'another/c/sub' } } }, ['a', 'b', 'c', 'a/sub/one'], function(a, b, c, one) { doh.register( 'mapConfigStar', [ function mapConfigStar(t){ t.is('c1', a.c.name); t.is('c1/sub', a.csub.name); t.is('c2', one.c.name); t.is('another/c/sub', one.csub.name); t.is('another/c/dim', one.csub.dimName); t.is('another/c', b.c.name); t.is('another/minor', b.c.minorName); t.is('another/c/sub', b.csub.name); t.is('another/c', c.name); t.is('another/minor', c.minorName); } ] ); doh.run(); } ); define("mapConfigStar-tests", function(){}); almond-0.2.9/tests/mapConfig/mapConfigStarAdapter.html000066400000000000000000000010531226333677700230040ustar00rootroot00000000000000 require.js: Map Config Star Adapter Built Test

require.js: Map Config Star Adapter Built Test

Test using '*' with an adapter in the built map config.

Check console for messages

almond-0.2.9/tests/mapConfig/mapConfigStarAdapter.js000066400000000000000000000016601226333677700224600ustar00rootroot00000000000000 define('d',{ name: 'd' }); define('adapter/d',['d'], function(d) { d.adapted = true; return d; }); define('e',['d'], function (d) { return { name: 'e', d: d }; }); /*global doh */ require({ baseUrl: './', map: { '*': { 'd': 'adapter/d' }, 'adapter/d': { d: 'd' } } }, ['e', 'adapter/d'], function(e, adapterD) { doh.register( 'mapConfigStarAdapter', [ function mapConfigStarAdapter(t){ t.is('e', e.name); t.is('d', e.d.name); t.is(true, e.d.adapted); t.is(true, adapterD.adapted); t.is('d', adapterD.name); } ] ); doh.run(); } ); define("mapConfigStarAdapter-tests", function(){}); almond-0.2.9/tests/missing/000077500000000000000000000000001226333677700156275ustar00rootroot00000000000000almond-0.2.9/tests/missing/missing.html000066400000000000000000000032751226333677700201750ustar00rootroot00000000000000 almond: No Name Test

almond: No Name Test

Test that an error from a missing name for a define gives a usuable message. Only catches some cases of this though.

Check console for messages

almond-0.2.9/tests/moduleConfig/000077500000000000000000000000001226333677700165715ustar00rootroot00000000000000almond-0.2.9/tests/moduleConfig/moduleConfig.html000066400000000000000000000023511226333677700220730ustar00rootroot00000000000000 almond: moduleConfig Test

almond: moduleConfig Test

Check console for messages

almond-0.2.9/tests/moduleConfig/moduleConfig.js000066400000000000000000000005321226333677700215420ustar00rootroot00000000000000 define('foo', function (require, exports, module) { return { locale: module.config().locale }; }); define('bar', ['module'], function (module) { return { color: module.config().color }; }); define('baz', ['module'], function (module) { return { doesNotExist: module.config().doesNotExist }; }); almond-0.2.9/tests/packagesNode/000077500000000000000000000000001226333677700165425ustar00rootroot00000000000000almond-0.2.9/tests/packagesNode/main-built.js000066400000000000000000000016111226333677700211400ustar00rootroot00000000000000 define('foo/lib/bar',{ name: 'bar' }); define('foo/lib/baz',['./bar'], function (bar) { return { name: 'baz', bar: bar }; }); define('foo/lib/index',['./bar.js', './baz'], function (bar, baz) { return { name: 'foo', bar: bar, baz: baz }; }); define('foo', ['foo/lib/index'], function (main) { return main; }); require({ nodeIdCompat: true, packages: [{ name: 'foo', location: 'node_modules/foo', main: 'lib/index' }] }, ['foo'], function (foo) { doh.register( 'packagesNode', [ function packagesNode(t){ t.is('foo', foo.name); t.is('bar', foo.bar.name); t.is('baz', foo.baz.name); t.is('bar', foo.baz.bar.name); } ] ); doh.run(); }); define("packagesNode-tests", function(){}); almond-0.2.9/tests/packagesNode/packagesNode.html000066400000000000000000000012221226333677700220110ustar00rootroot00000000000000 require.js: Packages Node-Style Test

require.js: Packages Node-Style Test

Test package that uses ".js" node-style module ID references inside a package. More info: r.js 591

Check console for messages

almond-0.2.9/tests/plugins/000077500000000000000000000000001226333677700156375ustar00rootroot00000000000000almond-0.2.9/tests/plugins/coffee.html000066400000000000000000000014451226333677700177600ustar00rootroot00000000000000 almond: Coffee Test

almond: Coffee Test

Check console for messages

almond-0.2.9/tests/plugins/coffee.js000066400000000000000000000026741226333677700174350ustar00rootroot00000000000000 /** * @license cs 0.2.1 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/require-cs for details * * CoffeeScript is Copyright (c) 2011 Jeremy Ashkenas * http://jashkenas.github.com/coffee-script/ * CoffeeScriptVersion: '1.1.1' */ /* Yes, deliciously evil. */ /*jslint evil: true, strict: false, plusplus: false, regexp: false */ /*global require: false, XMLHttpRequest: false, ActiveXObject: false, define: false, process: false, window: false */ (function () { define('cs',{ version: '0.2.1', load: function (name, parentRequire, load, config) { } }); }()); (function() { define('cs!controller',{ attach: function(view) { //return require.ready(function() { return view.render(); //}); } }); }).call(this); (function() { define('cs!util',{ toDom: function(text) { return 'dom:' + text; } }); }).call(this); (function() { define('cs!view',['cs!util'], function(util) { return { render: function(body) { return util.toDom('This is a rendered view'); } }; }); }).call(this); (function() { define('cs!csmain',['cs!controller', 'cs!view'], function(controller, view) { return controller.attach(view); }); }).call(this); require({ paths: { cs: '../../cs' } }, ['cs!csmain']); define("main", function(){}); almond-0.2.9/tests/plugins/order/000077500000000000000000000000001226333677700167525ustar00rootroot00000000000000almond-0.2.9/tests/plugins/order/order-built.js000066400000000000000000000477741226333677700215630ustar00rootroot00000000000000 /** * almond dev0.2 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ //Going sloppy to avoid 'use strict' string cost, but strict practices should //be followed. /*jslint sloppy: true */ /*global setTimeout: false */ var requirejs, require, define; (function (undef) { var main, req, makeMap, defined = {}, waiting = {}, config = {}, defining = {}, aps = [].slice; /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @returns {String} normalized name */ function normalize(name, baseName) { var nameParts, nameSegment, mapValue, foundMap, foundI, foundStarMap, starI, i, j, part, baseParts = baseName && baseName.split("/"), map = config.map, starMap = (map && map['*']) || {}; //Adjust any relative paths. if (name && name.charAt(0) === ".") { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { //Convert baseName to array, and lop off the last part, //so that . matches that "directory" and not name of the baseName's //module. For instance, baseName of "one/two/three", maps to //"one/two/three.js", but we want the directory, "one/two" for //this normalization. baseParts = baseParts.slice(0, baseParts.length - 1); name = baseParts.concat(name.split("/")); //start trimDots for (i = 0; i < name.length; i += 1) { part = name[i]; if (part === ".") { name.splice(i, 1); i -= 1; } else if (part === "..") { if (i === 1 && (name[2] === '..' || name[0] === '..')) { //End of the line. Keep at least one non-dot //path segment at the front so it can be mapped //correctly to disk. Otherwise, there is likely //no path mapping for a path starting with '..'. //This can still fail, but catches the most reasonable //uses of .. break; } else if (i > 0) { name.splice(i - 1, 2); i -= 2; } } } //end trimDots name = name.join("/"); } } //Apply map config if available. if ((baseParts || starMap) && map) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join("/"); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = map[baseParts.slice(0, j).join('/')]; //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && starMap[nameSegment]) { foundStarMap = starMap[nameSegment]; starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function makeRequire(relName, forceSync) { return function () { //A version of a require function that passes a moduleName //value for items that may need to //look up paths relative to the moduleName return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync])); }; } function makeNormalize(relName) { return function (name) { return normalize(name, relName); }; } function makeLoad(depName) { return function (value) { defined[depName] = value; }; } function callDep(name) { if (waiting.hasOwnProperty(name)) { var args = waiting[name]; delete waiting[name]; defining[name] = true; main.apply(undef, args); } if (!defined.hasOwnProperty(name)) { throw new Error('No ' + name); } return defined[name]; } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } /** * Makes a name map, normalizing the name, and using a plugin * for normalization if necessary. Grabs a ref to plugin * too, as an optimization. */ makeMap = function (name, relName) { var plugin, parts = splitPrefix(name), prefix = parts[0]; name = parts[1]; if (prefix) { prefix = normalize(prefix, relName); plugin = callDep(prefix); } //Normalize according if (prefix) { if (plugin && plugin.normalize) { name = plugin.normalize(name, makeNormalize(relName)); } else { name = normalize(name, relName); } } else { name = normalize(name, relName); parts = splitPrefix(name); prefix = parts[0]; name = parts[1]; if (prefix) { plugin = callDep(prefix); } } //Using ridiculous property names for space reasons return { f: prefix ? prefix + '!' + name : name, //fullName n: name, pr: prefix, p: plugin }; }; function makeConfig(name) { return function () { return (config && config.config && config.config[name]) || {}; }; } main = function (name, deps, callback, relName) { var cjsModule, depName, ret, map, i, args = [], usingExports; //Use name if no relName relName = relName || name; //Call the callback to define the module, if necessary. if (typeof callback === 'function') { //Pull out the defined dependencies and pass the ordered //values to the callback. //Default to [require, exports, module] if no deps deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; for (i = 0; i < deps.length; i += 1) { map = makeMap(deps[i], relName); depName = map.f; //Fast path CommonJS standard dependencies. if (depName === "require") { args[i] = makeRequire(name); } else if (depName === "exports") { //CommonJS module spec 1.1 args[i] = defined[name] = {}; usingExports = true; } else if (depName === "module") { //CommonJS module spec 1.1 cjsModule = args[i] = { id: name, uri: '', exports: defined[name], config: makeConfig(name) }; } else if (defined.hasOwnProperty(depName) || waiting.hasOwnProperty(depName)) { args[i] = callDep(depName); } else if (map.p) { map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); args[i] = defined[depName]; } else if (!defining[depName]) { throw new Error(name + ' missing ' + depName); } } ret = callback.apply(defined[name], args); if (name) { //If setting exports via "module" is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) { defined[name] = cjsModule.exports; } else if (ret !== undef || !usingExports) { //Use the return value from the function. defined[name] = ret; } } } else if (name) { //May just be an object definition for the module. Only //worry about defining if have a module name. defined[name] = callback; } }; requirejs = require = req = function (deps, callback, relName, forceSync, alt) { if (typeof deps === "string") { //Just return the module wanted. In this scenario, the //deps arg is the module name, and second arg (if passed) //is just the relName. //Normalize module name, if it contains . or .. return callDep(makeMap(deps, callback).f); } else if (!deps.splice) { //deps is a config object, not an array. config = deps; if (callback.splice) { //callback is an array, which means it is a dependency list. //Adjust args if there are dependencies deps = callback; callback = relName; relName = null; } else { deps = undef; } } //Support require(['a']) callback = callback || function () {}; //If relName is a function, it is an errback handler, //so remove it. if (typeof relName === 'function') { relName = forceSync; forceSync = alt; } //Simulate async callback; if (forceSync) { main(undef, deps, callback, relName); } else { setTimeout(function () { main(undef, deps, callback, relName); }, 15); } return req; }; /** * Just drops the config on the floor, but returns req in case * the config return value is used. */ req.config = function (cfg) { config = cfg; return req; }; define = function (name, deps, callback) { //This module may not have dependencies if (!deps.splice) { //deps is not an array, so probably means //an object literal or factory function for //the value. Adjust args. callback = deps; deps = []; } waiting[name] = [name, deps, callback]; }; define.amd = { jQuery: true }; }()); define("../../../almond", function(){}); /** * @license RequireJS order 1.0.5 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ /*jslint nomen: false, plusplus: false, strict: false */ /*global require: false, define: false, window: false, document: false, setTimeout: false */ //Specify that requirejs optimizer should wrap this code in a closure that //maps the namespaced requirejs API to non-namespaced local variables. /*requirejs namespace: true */ (function () { //Sadly necessary browser inference due to differences in the way //that browsers load and execute dynamically inserted javascript //and whether the script/cache method works when ordered execution is //desired. Currently, Gecko and Opera do not load/fire onload for scripts with //type="script/cache" but they execute injected scripts in order //unless the 'async' flag is present. //However, this is all changing in latest browsers implementing HTML5 //spec. With compliant browsers .async true by default, and //if false, then it will execute in order. Favor that test first for forward //compatibility. var testScript = typeof document !== "undefined" && typeof window !== "undefined" && document.createElement("script"), supportsInOrderExecution = testScript && (testScript.async || ((window.opera && Object.prototype.toString.call(window.opera) === "[object Opera]") || //If Firefox 2 does not have to be supported, then //a better check may be: //('mozIsLocallyAvailable' in window.navigator) ("MozAppearance" in document.documentElement.style))), //This test is true for IE browsers, which will load scripts but only //execute them once the script is added to the DOM. supportsLoadSeparateFromExecute = testScript && testScript.readyState === 'uninitialized', readyRegExp = /^(complete|loaded)$/, cacheWaiting = [], cached = {}, scriptNodes = {}, scriptWaiting = []; //Done with the test script. testScript = null; //Callback used by the type="script/cache" callback that indicates a script //has finished downloading. function scriptCacheCallback(evt) { var node = evt.currentTarget || evt.srcElement, i, moduleName, resource; if (evt.type === "load" || readyRegExp.test(node.readyState)) { //Pull out the name of the module and the context. moduleName = node.getAttribute("data-requiremodule"); //Mark this cache request as loaded cached[moduleName] = true; //Find out how many ordered modules have loaded for (i = 0; (resource = cacheWaiting[i]); i++) { if (cached[resource.name]) { resource.req([resource.name], resource.onLoad); } else { //Something in the ordered list is not loaded, //so wait. break; } } //If just loaded some items, remove them from cacheWaiting. if (i > 0) { cacheWaiting.splice(0, i); } //Remove this script tag from the DOM //Use a setTimeout for cleanup because some older IE versions vomit //if removing a script node while it is being evaluated. setTimeout(function () { node.parentNode.removeChild(node); }, 15); } } /** * Used for the IE case, where fetching is done by creating script element * but not attaching it to the DOM. This function will be called when that * happens so it can be determined when the node can be attached to the * DOM to trigger its execution. */ function onFetchOnly(node) { var i, loadedNode, resourceName; //Mark this script as loaded. node.setAttribute('data-orderloaded', 'loaded'); //Cycle through waiting scripts. If the matching node for them //is loaded, and is in the right order, add it to the DOM //to execute the script. for (i = 0; (resourceName = scriptWaiting[i]); i++) { loadedNode = scriptNodes[resourceName]; if (loadedNode && loadedNode.getAttribute('data-orderloaded') === 'loaded') { delete scriptNodes[resourceName]; require.addScriptToDom(loadedNode); } else { break; } } //If just loaded some items, remove them from waiting. if (i > 0) { scriptWaiting.splice(0, i); } } define('order',{ version: '1.0.5', load: function (name, req, onLoad, config) { var hasToUrl = !!req.nameToUrl, url, node, context; //If no nameToUrl, then probably a build with a loader that //does not support it, and all modules are inlined. if (!hasToUrl) { req([name], onLoad); return; } url = req.nameToUrl(name, null); //Make sure the async attribute is not set for any pathway involving //this script. require.s.skipAsync[url] = true; if (supportsInOrderExecution || config.isBuild) { //Just a normal script tag append, but without async attribute //on the script. req([name], onLoad); } else if (supportsLoadSeparateFromExecute) { //Just fetch the URL, but do not execute it yet. The //non-standards IE case. Really not so nice because it is //assuming and touching requrejs internals. OK though since //ordered execution should go away after a long while. context = require.s.contexts._; if (!context.urlFetched[url] && !context.loaded[name]) { //Indicate the script is being fetched. context.urlFetched[url] = true; //Stuff from require.load require.resourcesReady(false); context.scriptCount += 1; //Fetch the script now, remember it. node = require.attach(url, context, name, null, null, onFetchOnly); scriptNodes[name] = node; scriptWaiting.push(name); } //Do a normal require for it, once it loads, use it as return //value. req([name], onLoad); } else { //Credit to LABjs author Kyle Simpson for finding that scripts //with type="script/cache" allow scripts to be downloaded into //browser cache but not executed. Use that //so that subsequent addition of a real type="text/javascript" //tag will cause the scripts to be executed immediately in the //correct order. if (req.specified(name)) { req([name], onLoad); } else { cacheWaiting.push({ name: name, req: req, onLoad: onLoad }); require.attach(url, null, name, scriptCacheCallback, "script/cache"); } } } }); }()); var one = { name: 'one' }; define("one", function(){}); var two = { name: 'two', oneName: one.name }; define("two", function(){}); almond-0.2.9/tests/plugins/order/order.html000066400000000000000000000017311226333677700207550ustar00rootroot00000000000000 almond: Order Plugin Test

almond: Order Plugin Test

Check console for messages

almond-0.2.9/tests/plugins/pluginMapSameName/000077500000000000000000000000001226333677700212025ustar00rootroot00000000000000almond-0.2.9/tests/plugins/pluginMapSameName/pluginMapSameName.html000066400000000000000000000013261226333677700254350ustar00rootroot00000000000000 almond: Plugin Map Same Name Test

almond: Plugin Map Same Name Test

Test using the map config with plugins. but include a map value that contains the original name of the plugin, to confirm the map translation is only done once: 484

Check console for messages

almond-0.2.9/tests/plugins/pluginMapSameName/pluginMapSameName.js000066400000000000000000000007271226333677700251110ustar00rootroot00000000000000 define('plugin/plugin',{ load: function (id, require, load, config) { load(id); } }); require({ map: { '*': { 'plugin': 'plugin/plugin' } } }, ['plugin!foo'], function (value) { doh.register( 'pluginMapSameName', [ function pluginMapSameName(t){ t.is('foo', value); } ] ); doh.run(); }); define("pluginMapSameName-tests", function(){}); almond-0.2.9/tests/plugins/plugins.html000066400000000000000000000022461226333677700202120ustar00rootroot00000000000000 almond: Simple Test

almond: Simple Test

Check console for messages

almond-0.2.9/tests/plugins/plugins.js000066400000000000000000000040331226333677700176560ustar00rootroot00000000000000 (function () { function parse(name) { var parts = name.split('?'), index = parseInt(parts[0], 10), choices = parts[1].split(':'), choice = choices[index]; return { index: index, choices: choices, choice: choice }; } define('index',{ pluginBuilder: './indexBuilder', normalize: function (name, normalize) { var parsed = parse(name), choices = parsed.choices; //Normalize each path choice. for (i = 0; i < choices.length; i++) { choices[i] = normalize(choices[i]); } return parsed.index + '?' + choices.join(':'); }, load: function (name, req, load, config) { req([parse(name).choice], function (value) { load(value); }); } }); }()); define('a',{ name: 'a' }); define('c',{ name: "c" }); define('b',[],function () { return { name: "b" }; }); define('earth',['require','./index!0?./a:./b:./c','./index!2?./a:./b:./c','./index!1?./a:./b:./c'],function (require) { return { getA: function () { return require("./index!0?./a:./b:./c"); }, getC: function () { return require("./index!2?./a:./b:./c"); }, getB: function () { return require("./index!1?./a:./b:./c"); } }; }); define('prime/a',{ name: 'aPrime' }); define('prime/c',{ name: "cPrime" }); define('prime/b',[],function () { return { name: "bPrime" }; }); define('prime/earth',['require','../index!0?./a:./b:./c','../index!2?./a:./b:./c','../index!1?./a:./b:./c'],function (require) { return { getA: function () { return require("../index!0?./a:./b:./c"); }, getC: function () { return require("../index!2?./a:./b:./c"); }, getB: function () { return require("../index!1?./a:./b:./c"); } }; }); almond-0.2.9/tests/plugins/text.html000066400000000000000000000022011226333677700175040ustar00rootroot00000000000000 almond: Text Test

almond: Text Test

Check console for messages

almond-0.2.9/tests/plugins/text.js000066400000000000000000000274611226333677700171730ustar00rootroot00000000000000 /** * @license RequireJS text 0.26.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ /*jslint regexp: false, nomen: false, plusplus: false, strict: false */ /*global require: false, XMLHttpRequest: false, ActiveXObject: false, define: false, window: false, process: false, Packages: false, java: false, location: false */ (function () { var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'], xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, bodyRegExp = /]*>\s*([\s\S]+)\s*<\/body>/im, hasLocation = typeof location !== 'undefined' && location.href, buildMap = []; define('text',[],function () { var text, get, fs; if (typeof window !== "undefined" && window.navigator && window.document) { get = function (url, callback) { var xhr = text.createXhr(); xhr.open('GET', url, true); xhr.onreadystatechange = function (evt) { //Do not explicitly handle errors, those should be //visible via console output in the browser. if (xhr.readyState === 4) { callback(xhr.responseText); } }; xhr.send(null); }; } else if (typeof process !== "undefined" && process.versions && !!process.versions.node) { //Using special require.nodeRequire, something added by r.js. fs = require.nodeRequire('fs'); get = function (url, callback) { callback(fs.readFileSync(url, 'utf8')); }; } else if (typeof Packages !== 'undefined') { //Why Java, why is this so awkward? get = function (url, callback) { var encoding = "utf-8", file = new java.io.File(url), lineSeparator = java.lang.System.getProperty("line.separator"), input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)), stringBuffer, line, content = ''; try { stringBuffer = new java.lang.StringBuffer(); line = input.readLine(); // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 // http://www.unicode.org/faq/utf_bom.html // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 if (line && line.length() && line.charAt(0) === 0xfeff) { // Eat the BOM, since we've already found the encoding on this file, // and we plan to concatenating this buffer with others; the BOM should // only appear at the top of a file. line = line.substring(1); } stringBuffer.append(line); while ((line = input.readLine()) !== null) { stringBuffer.append(lineSeparator); stringBuffer.append(line); } //Make sure we return a JavaScript string and not a Java string. content = String(stringBuffer.toString()); //String } finally { input.close(); } callback(content); }; } text = { version: '0.26.0', strip: function (content) { //Strips declarations so that external SVG and XML //documents can be added to a document without worry. Also, if the string //is an HTML document, only the part inside the body tag is returned. if (content) { content = content.replace(xmlRegExp, ""); var matches = content.match(bodyRegExp); if (matches) { content = matches[1]; } } else { content = ""; } return content; }, jsEscape: function (content) { return content.replace(/(['\\])/g, '\\$1') .replace(/[\f]/g, "\\f") .replace(/[\b]/g, "\\b") .replace(/[\n]/g, "\\n") .replace(/[\t]/g, "\\t") .replace(/[\r]/g, "\\r"); }, createXhr: function () { //Would love to dump the ActiveX crap in here. Need IE 6 to die first. var xhr, i, progId; if (typeof XMLHttpRequest !== "undefined") { return new XMLHttpRequest(); } else { for (i = 0; i < 3; i++) { progId = progIds[i]; try { xhr = new ActiveXObject(progId); } catch (e) {} if (xhr) { progIds = [progId]; // so faster next time break; } } } if (!xhr) { throw new Error("createXhr(): XMLHttpRequest not available"); } return xhr; }, get: get, /** * Parses a resource name into its component parts. Resource names * look like: module/name.ext!strip, where the !strip part is * optional. * @param {String} name the resource name * @returns {Object} with properties "moduleName", "ext" and "strip" * where strip is a boolean. */ parseName: function (name) { var strip = false, index = name.indexOf("."), modName = name.substring(0, index), ext = name.substring(index + 1, name.length); index = ext.indexOf("!"); if (index !== -1) { //Pull off the strip arg. strip = ext.substring(index + 1, ext.length); strip = strip === "strip"; ext = ext.substring(0, index); } return { moduleName: modName, ext: ext, strip: strip }; }, xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/, /** * Is an URL on another domain. Only works for browser use, returns * false in non-browser environments. Only used to know if an * optimized .js version of a text resource should be loaded * instead. * @param {String} url * @returns Boolean */ canUseXhr: function (url, protocol, hostname, port) { var match = text.xdRegExp.exec(url), uProtocol, uHostName, uPort; if (!match) { return true; } uProtocol = match[2]; uHostName = match[3]; uHostName = uHostName.split(':'); uPort = uHostName[1]; uHostName = uHostName[0]; return (!uProtocol || uProtocol === protocol) && (!uHostName || uHostName === hostname) && ((!uPort && !uHostName) || uPort === port); }, finishLoad: function (name, strip, content, onLoad, config) { content = strip ? text.strip(content) : content; if (config.isBuild && config.inlineText) { buildMap[name] = content; } onLoad(content); }, load: function (name, req, onLoad, config) { //Name has format: some.module.filext!strip //The strip part is optional. //if strip is present, then that means only get the string contents //inside a body tag in an HTML string. For XML/SVG content it means //removing the declarations so the content can be inserted //into the current doc without problems. var parsed = text.parseName(name), nonStripName = parsed.moduleName + '.' + parsed.ext, url = req.toUrl(nonStripName); //Load the text. Use XHR if possible and in a browser. if (!hasLocation || text.canUseXhr(url)) { text.get(url, function (content) { text.finishLoad(name, parsed.strip, content, onLoad, config); }); } else { //Need to fetch the resource across domains. Assume //the resource has been optimized into a JS module. Fetch //by the module name + extension, but do not include the //!strip part to avoid file system issues. req([nonStripName], function (content) { text.finishLoad(parsed.moduleName + '.' + parsed.ext, parsed.strip, content, onLoad, config); }); } }, write: function (pluginName, moduleName, write, config) { if (moduleName in buildMap) { var content = text.jsEscape(buildMap[moduleName]); write("define('" + pluginName + "!" + moduleName + "', function () { return '" + content + "';});\n"); } }, writeFile: function (pluginName, moduleName, req, write, config) { var parsed = text.parseName(moduleName), nonStripName = parsed.moduleName + '.' + parsed.ext, //Use a '.js' file name so that it indicates it is a //script that can be loaded across domains. fileName = req.toUrl(parsed.moduleName + '.' + parsed.ext) + '.js'; //Leverage own load() method to load plugin value, but only //write out values that do not have the strip argument, //to avoid any potential issues with ! in file names. text.load(nonStripName, req, function (value) { //Use own write() method to construct full module value. text.write(pluginName, nonStripName, function (contents) { write(fileName, contents); }, config); }, config); } }; return text; }); }()); define('text!subwidget.html!strip', function () { return '

This is a subwidget

';}); define('text!subwidget2.html', function () { return 'This! is template2';}); define("subwidget", ["text!subwidget.html!strip", "text!subwidget2.html"], function(template, template2) { return { name: "subwidget", template: template, template2: template2 }; } ); define('text!widget.html', function () { return '

This is a widget!

I am in a widget

';}); define("widget", ["subwidget", "text!widget.html"], function(subwidget, template) { return { subWidgetName: subwidget.name, subWidgetTemplate: subwidget.template, subWidgetTemplate2: subwidget.template2, template: template }; } ); almond-0.2.9/tests/relativePaths/000077500000000000000000000000001226333677700167715ustar00rootroot00000000000000almond-0.2.9/tests/relativePaths/relativePaths.html000066400000000000000000000035111226333677700224720ustar00rootroot00000000000000 almond: relativePaths Test

almond: Relative Paths Test

Test relative dependency paths with almond. More info: 28.

Check console for messages

almond-0.2.9/tests/runner.js000066400000000000000000000015261226333677700160310ustar00rootroot00000000000000var page = require('webpage').create(); page.onAlert = function () { if (page.evaluate(function () { return doh._doneForPhantom; })) { var problems = page.evaluate(function () { return doh._errorCount + doh._failureCount; }); phantom.exit(problems ? 1 : 0); } }; var first = true; page.onLoadFinished = function (status) { if (first) { first = false; page.evaluate(function () { var oldReport = doh._report; doh._report = function () { oldReport.apply(doh, arguments); this._doneForPhantom = true; alert(); }; doh.run(); }); } }; page.onConsoleMessage = function () { console.log.apply(console, arguments); }; page.open('http://localhost:1986/tests/doh/runner.html?testUrl=../all'); almond-0.2.9/tests/server.js000066400000000000000000000002521226333677700160210ustar00rootroot00000000000000var connect = require('connect'); connect.createServer(connect.static(__dirname + '/..')).listen(1986); require('fs').writeFileSync(__dirname + '/pid.txt', process.pid); almond-0.2.9/tests/shim/000077500000000000000000000000001226333677700151165ustar00rootroot00000000000000almond-0.2.9/tests/shim/shim.html000066400000000000000000000022301226333677700167410ustar00rootroot00000000000000 almond: Shim Test

almond: moduleConfig Test

Check console for messages

almond-0.2.9/tests/shim/shim.js000066400000000000000000000016711226333677700164210ustar00rootroot00000000000000//Taken from requirejs/tests/shim/built/basic-tests.js (function (root) { root.A = { name: 'a' }; }(this)); define("a", (function (global) { return function () { var ret = global.A.name; var fn = function () { window.globalA = this.A.name; }; fn.apply(global, arguments); return ret; }; }(this))); function D() { this.name = 'd'; }; define("d", function(){}); var B = { name: 'b', aValue: A.name, dValue: new D() }; define("b", function(){}); var C = { name: 'c', a: A, b: B }; define("c", ["a","b"], (function (global) { return function () { var ret = global.C; return ret; }; }(this))); var e = { nested: { e: { name: 'e' } } }; define("e", (function (global) { return function () { var ret = global.e.nested.e; return ret; }; }(this))); almond-0.2.9/tests/simple.html000066400000000000000000000022631226333677700163400ustar00rootroot00000000000000 almond: Simple Test

almond: Simple Test

Check console for messages

almond-0.2.9/tests/simple.js000066400000000000000000000006641226333677700160130ustar00rootroot00000000000000 define('foo', { name: 'foo' }); define('bar', [], function() { return { name: 'bar' } }); define('baz', ['require', 'exports', 'module', './bar'], function (require, exports, module) { var bar = require('./bar'); exports.name = 'baz'; exports.barName = bar.name; exports.callIt = function (callback) { require(['./bar'], function (bar) { callback(bar); }); } }); almond-0.2.9/tests/specialDeps/000077500000000000000000000000001226333677700164125ustar00rootroot00000000000000almond-0.2.9/tests/specialDeps/specialDeps-tests.js000066400000000000000000000010111226333677700223350ustar00rootroot00000000000000define('foo', function(require, exports, module) { require('exports').name = 'foo'; require('require')('exports').related = require('module').config().related; }); require.config({ config: { foo: { related: 'bar' } } }); require(["foo"], function (foo) { doh.register( "specialDeps", [ function specialDeps(t) { t.is("foo", foo.name); t.is("bar", foo.related); } ] ); doh.run(); }); almond-0.2.9/tests/specialDeps/specialDeps.html000066400000000000000000000012011226333677700215260ustar00rootroot00000000000000 almond: Special Dependencies Test

almond: Special Dependencies Test

Tests for require("require"|"exports"|"module") inside a module. More info.

Check console for messages

almond-0.2.9/tests/topRelativeRequire/000077500000000000000000000000001226333677700200115ustar00rootroot00000000000000almond-0.2.9/tests/topRelativeRequire/topRelativeRequire.html000066400000000000000000000017341226333677700245370ustar00rootroot00000000000000 almond: Top Relative Require Test

almond: Top Relative Require Test

Test top relative require . More info: 46.

Check console for messages

almond-0.2.9/tests/unordered/000077500000000000000000000000001226333677700161455ustar00rootroot00000000000000almond-0.2.9/tests/unordered/separate.html000066400000000000000000000015441226333677700206430ustar00rootroot00000000000000 almond: Unordered, Separate Test

almond: Unordered, Separate Test

Modules are unordered, and loaded separate from almond.js

Check console for messages

almond-0.2.9/tests/unordered/separate.js000066400000000000000000000012201226333677700203020ustar00rootroot00000000000000 define("bread", function(require, exports, module) { exports.name = 'bread'; exports.ingredient = require('yeast').name; }); //Test undefined exports. define("water", function () {}); define("bin", function(require, exports, module) { exports.name = "bin"; exports.water = require("water"); }); define("yeast", function(require,exports,module){ module.exports = { name: 'yeast', water: require("water"), bin: require("bin") }; }); //Using sync require, but callback-require([], function(){}) is suggested. //This form only used in some particular CommonJS module bundling. var bread = require('bread');