Code Monkey home page Code Monkey logo

hykoans's Introduction

hykoans

Warning: WORK IN PROGRESS

I am developing this project as a way to get more familiar with Hy.

It is not clear whether this will be a straight port of Python Koans or Clojure Koans or just a new Koans project all in itself to identify the Hy language specifics (after all - Hy is still python).

Please feel free to give feedback in the issues or contribute a pull request. The main reason for this is to learn new things. ๐Ÿบ

Version

This has been tested to run with a Hy version as recent as stable which as of this writing is 0.11.1.

Hy latest is unlikely to work given syntactic differences from the current stable release.

Instructions

You cannot pip install hykoans yet but you can install it and Hy to your virtualenv by typing:

python setup.py install

Then you can run the command

hyk

If you see something like the test failure below - you're well on your way!

======================================================================
FAIL: test_assert_truth (koans.a_asserts.Asserts)
We shall contemplate truth by testing reality, via asserts.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/youruser/hykoans/koans/a_asserts", line 10, in test_assert_truth
    (self.assertTrue (= ____ True)))]
AssertionError: False is not true
----------------------------------------------------------------------

Now What?

The objective of the Koans project is to get each test passing to demonstrate an understanding of the intention of the unit test. As you can see from the above test we've got AssertionError: False is not true. In order to correct this test go into koans/a_asserts.hy and change the first test to the following.

  [test-1-assert-truth
    (fn [self]
      "We shall contemplate truth by testing reality, via asserts."
      (self.assertTrue (= True True)))]

of course the fun doesn't end there. Now you're getting a new failure.

======================================================================
FAIL: test_assert_with_message (koans.a_asserts.Asserts)
Enlightenment may be more easily achieved with appropriate messages.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/youruser/hykoans/koans/a_asserts.hy", line 15, in test_assert_with_message
    (self.assertTrue (= ____ True) "This should be True, fix it!"))]
AssertionError: This should be True, fix it!
----------------------------------------------------------------------

I'll let you take it from here.

hykoans's People

Contributors

skovsgaard avatar taddeimania avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.