Giter Site home page Giter Site logo

helloworld_scalatest's Introduction

What is this

This is a (nearly) minimal setting for doing a unit testing for Scala. Below I list the commands as a pense-bete. Scala package myPackage includes MyLib.scala that defines a function to test, and MyTestSuite.scala that does the test; Two ScalaTest jar files are put into the repo for your convenience.

I have intentionally avoided sbt, a complex beast. The commands below use only scalac and scala. Use them from the directory where myPackage can be accessed without additional scoping.

How to compile

scalac -cp scalatest_2.12-3.0.5.jar:scalactic_2.12-3.0.5.jar myPackage/MyLib.scala myPackage/MyTestSuite.scala

How to run the tests

scala -cp scalatest_2.12-3.0.5.jar:scalactic_2.12-3.0.5.jar org.scalatest.run myPackage.MyTestSuite

Expected results

Run starting. Expected test count is: 2
MyTestSuite:
- square(-1)=1
- square(0)=0
Run completed in 115 milliseconds.
Total number of tests run: 2
Suites: completed 1, aborted 0
Tests: succeeded 2, failed 0, canceled 0, ignored 0, pending 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.