Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arguiot committed Feb 20, 2018
1 parent d0e1e9b commit 87d7953
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dist: trusty
sudo: required
env:
- SWIFT_VERSION=4.0.3
language: node_js
node_js:
- "node"
- "lts/*"
- "7"
- "8"
before_install:
- npm install -g npm@latest
- npm install -g eye.js
install:
- eval "$(curl -sL https://swiftenv.fuller.li/install.sh)" # Install swift
script:
- eye # JS
- swiftc swift/lib.swift -o out # Swift
notifications:
email: false
14 changes: 14 additions & 0 deletions js/__test__/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Test made using EyeJS - https://eye.js.org

const path = require('path').normalize(__testDir + "/../")

const { encrypt, decrypt } = require(path + "lib.js")

eye.test("Encryption", "node",
$ => $(encrypt("Hello World!")).Equal("H3ll0 W0rld!"),
$ => $(encrypt("LEETLANGUAGE")).Equal("L337L4N6U463")
)
eye.test("Decryption", "node",
$ => $(decrypt("H3ll0 W0rld!")).Equal("Hello World!"),
$ => $(decrypt(encrypt("CrypTools"))).Equal("Cryptools") // 'T' becomes 't', because T = t = 7
)

0 comments on commit 87d7953

Please sign in to comment.