-
-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit tests for the bundled compiler and compressor classes #531
Changes from all commits
74884f3
fd0be33
bb864e3
e74ab5c
6d3e470
c17fd82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(function() { | ||
var cube, square; | ||
|
||
square = function(x) { | ||
return x * x; | ||
}; | ||
|
||
cube = function(x) { | ||
return square(x) * x; | ||
}; | ||
|
||
}).call(this); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
square = (x) -> x * x | ||
cube = (x) -> square(x) * x |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use strict"; | ||
|
||
// Expression bodies | ||
var odds = evens.map(function (v) { | ||
return v + 1; | ||
}); | ||
var nums = evens.map(function (v, i) { | ||
return v + i; | ||
}); | ||
|
||
// Statement bodies | ||
nums.forEach(function (v) { | ||
if (v % 5 === 0) fives.push(v); | ||
}); | ||
|
||
// Lexical this | ||
var bob = { | ||
_name: "Bob", | ||
_friends: [], | ||
printFriends: function printFriends() { | ||
var _this = this; | ||
|
||
this._friends.forEach(function (f) { | ||
return console.log(_this._name + " knows " + f); | ||
}); | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Expression bodies | ||
var odds = evens.map(v => v + 1); | ||
var nums = evens.map((v, i) => v + i); | ||
|
||
// Statement bodies | ||
nums.forEach(v => { | ||
if (v % 5 === 0) | ||
fives.push(v); | ||
}); | ||
|
||
// Lexical this | ||
var bob = { | ||
_name: "Bob", | ||
_friends: [], | ||
printFriends() { | ||
this._friends.forEach(f => | ||
console.log(this._name + " knows " + f)); | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.a { | ||
width: 1px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@a: 1; | ||
|
||
.a { | ||
width: (@a + 0px); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(function(){ | ||
var times; | ||
times = function(x, y){ | ||
return x * y; | ||
}; | ||
}).call(this); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
times = (x, y) -> | ||
x * y |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.a .b { | ||
display: none; } | ||
|
||
.c .d { | ||
display: block; } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.a { | ||
.b { | ||
display: none; | ||
} | ||
} | ||
.c { | ||
.d { | ||
display: block; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.a { | ||
color: #000; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.a | ||
color: black |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(function(){(function(){window.concat=function(){console.log(arguments)}})();(function(){window.cat=function(){console.log("hello world")}})()}).call(this); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.concat{display:none}.concatenate{display:block} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.concat{display:none;}.concatenate{display:block;} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(function(){(function(){window.concat=function(){console.log(arguments)}})();(function(){window.cat=function(){console.log("hello world")}})()}).call(this); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.concat{display:none}.concatenate{display:block} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(function(){(function(){window.concat=function(){console.log(arguments)}})(),function(){window.cat=function(){console.log("hello world")}}()}).call(this); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.concat{display:none}.concatenate{display:block} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "django-pipeline-tests", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, good call |
||
"private": true, | ||
"version": "1.0.0", | ||
"description": "Pipeline is an asset packaging library for Django.", | ||
"author": "Timothée Peignier <[email protected]>", | ||
"license": "MIT", | ||
"readmeFilename": "../README.rst", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jazzband/django-pipeline.git" | ||
}, | ||
"dependencies": { | ||
"babel-cli": "^6.4.5", | ||
"babel-preset-es2015": "^6.3.13", | ||
"coffee-script": "^1.10.0", | ||
"less": "^2.5.3", | ||
"livescript": "^1.4.0", | ||
"node-sass": "^3.4.2", | ||
"stylus": "^0.53.0", | ||
"cssmin": "^0.4.3", | ||
"google-closure-compiler": "^20151216.2.0", | ||
"uglify-js": "^2.6.1", | ||
"yuglify": "^0.1.4", | ||
"yuicompressor": "^2.4.8" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python | ||
""" | ||
A cross-platform compatible `npm install` call, checking whether npm is | ||
in fact installed on the system first (and on windows, checking that the | ||
npm version is at least 3.0 because of a bug in 2.x with MAX_PATH) | ||
""" | ||
import distutils.spawn | ||
import os | ||
from pkg_resources import parse_version | ||
import re | ||
import subprocess | ||
import sys | ||
|
||
|
||
def main(): | ||
tests_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) | ||
if os.name == 'nt': | ||
try: | ||
npm_paths = subprocess.check_output(['where', 'npm.cmd']) | ||
except subprocess.CalledProcessError: | ||
return | ||
else: | ||
npm_bin = re.split(r'\r?\n', npm_paths)[0] | ||
else: | ||
npm_bin = distutils.spawn.find_executable('npm') | ||
if not npm_bin: | ||
return | ||
if os.name == 'nt': | ||
os.environ.setdefault('APPDATA', '.') | ||
npm_version = subprocess.check_output([npm_bin, '--version']).strip() | ||
# Skip on windows if npm version is less than 3 because of | ||
# MAX_PATH issues in version 2 | ||
if parse_version(npm_version) < parse_version('3.0'): | ||
return | ||
pipe = subprocess.Popen([npm_bin, 'install'], | ||
cwd=tests_dir, stdout=sys.stdout, stderr=sys.stderr) | ||
pipe.communicate() | ||
sys.exit(pipe.returncode) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if this had a docstring explaining what it does and why it's needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.