Permalink
Browse files

Updates test server.

  • Loading branch information...
dsc committed Apr 13, 2013
1 parent 382c32d commit ae4914d9fa62dfd5afdc7ab824f51763df50b308
Showing with 51 additions and 16 deletions.
  1. +16 −0 test/browser/src/livescript-test.ls
  2. +6 −0 test/browser/src/pythagoras.co
  3. +0 −2 test/browser/test.co
  4. +29 −14 test/server/server.co
@@ -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
@@ -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
+
View
@@ -1,2 +0,0 @@
-
-
View
@@ -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()'
@@ -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

0 comments on commit ae4914d

Please sign in to comment.