Skip to content

Commit

Permalink
Updates test server.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsc committed Apr 13, 2013
1 parent 382c32d commit ae4914d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 16 deletions.
16 changes: 16 additions & 0 deletions test/browser/src/livescript-test.ls
@@ -0,0 +1,16 @@
console.log "livescript!"

times = (x, y) --> x * y
console.log 'times 2, 3 #=> 6', times 2, 3 #=> 6 (normal use works as expected)
double = times 2
console.log 'double 5 #=> 10', double 5 #=> 10

filter-nums = filter _, [1 to 5]
console.log 'filter-nums even #=> [2,4]', filter-nums even #=> [2,4]
console.log 'filter-nums odd #=> [1,3,5]', filter-nums odd #=> [1,3,5]
console.log 'filter-nums (< 3) #=> [1,2]', filter-nums (< 3) #=> [1,2]

r = [1 2 3]
|> _.map _, (* 2)
|> _.reduce _, (+), 0
console.log '[1 2 3] |> map |> reduce #=> 12', r
6 changes: 6 additions & 0 deletions test/browser/src/pythagoras.co
@@ -0,0 +1,6 @@
export pythagorases =
for a from 9 to 1 by -1
for b from a til 99
h = (a*a + b*b) ** 0.5
[a, b, h] unless h % 1

2 changes: 0 additions & 2 deletions test/browser/test.co

This file was deleted.

43 changes: 29 additions & 14 deletions test/server/server.co
@@ -1,20 +1,27 @@
path = require 'path'
{ dirname, basename,
} = path = require 'path'
express = require 'express'


PORT = 8080
PROJECT_DIR = path.dirname __dirname
TESTS = __dirname
TESTS = dirname __dirname
PROJECT_DIR = dirname TESTS
VAR = PROJECT_DIR+'/var'
WWW = TESTS+'/browser'
VAR = TESTS+'/var'
SRC = WWW+'/src'


compiler = require PROJECT_DIR+'/compiler'


app = express.createServer()
app.listen PORT

console.log "Test Server started on port #PORT..."
console.log ">> Connect Compiler Test Server <<"
console.log ' PORT: ', PORT
console.log ' PROJECT_DIR: ', PROJECT_DIR
console.log ' TESTS: ', TESTS
console.log ' WWW: ', WWW
console.log ' VAR: ', VAR

app.configure ->
console.log 'server.configure()'
Expand All @@ -24,19 +31,27 @@ app.configure ->
app.use express.methodOverride()

app.use compiler do
enabled : <[ coco coffee jade stylus sass jison ]>
enabled : <[ livescript coco coffee ]>
src : WWW
dest : VAR
options :
stylus : nib:true, compress:true
# options :
# stylus : nib:true, compress:true
log_level : 'DEBUG'

# app.use compiler do
# enabled : <[ jade stylus sass jison ]>
# src : WWW
# dest : VAR
# options :
# stylus : nib:true, compress:true
# log_level : 'DEBUG'

# compress anything that desires compression (*.min.js)
app.use compiler do
enabled : <[ uglify ]>
src : [ WWW, VAR ]
dest : VAR
log_level : 'DEBUG'
# app.use compiler do
# enabled : <[ uglify ]>
# src : [ WWW, VAR ]
# dest : VAR
# log_level : 'DEBUG'

app.use express.static WWW
app.use express.static VAR
Expand Down

0 comments on commit ae4914d

Please sign in to comment.