Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/cli.ls
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,21 @@ command-eq '-cp test/data/data.json.ls', [json-content ]
command-eq '-cp --json test/data/data.ls', [json-content]

# json to files
normed-json = (ext = '') ->
(normalize 'test/data/data') ++ "#ext.ls => " ++ (normalize 'test/data/data.json')

do
# implicit json
<- command-eq '-c --debug test/data/data.json.ls', ['test/data/data.json.ls => test/data/data.json']
#<- command-eq '-c --debug test/data/data.json.ls', ['test/data/data.json.ls => test/data/data.json']
<- command-eq '-c --debug test/data/data.json.ls', [normed-json '.json']
try
ok file-exists 'test/data/data.json'
eq json-content + '\n', file-read 'test/data/data.json'
finally file-delete 'test/data/data.json'

# explicit json
<- command-eq '-cj --debug test/data/data.ls', ['test/data/data.ls => test/data/data.json']
#<- command-eq '-cj --debug test/data/data.ls', ['test/data/data.ls => test/data/data.json']
<- command-eq '-cj --debug test/data/data.ls', [normed-json!]
try
ok file-exists 'test/data/data.json'
eq json-content + '\n', file-read 'test/data/data.json'
Expand Down Expand Up @@ -86,7 +91,7 @@ command-eq '-c --debug --map linked test/data/empty.ls', [
# gkz/LiveScript#953
command-eq '-m embedded test/data/runtime-error.ls', [
'Failed at: test/data/runtime-error.ls'
/ReferenceError: doesNotExist is not defined\n at Object\.<anonymous> \(.*\/test\/data\/runtime-error\.ls:2:17\).*/
/ReferenceError: doesNotExist is not defined[\r\n]{1,2} at Object\.<anonymous> \([\.\*\\\/\:a-zA-Z]*runtime-error\.ls:2:17\).*/
]

# eval+compile
Expand Down