Giter VIP home page Giter VIP logo

particles's Introduction

Red particles

Pack of varied tools for Red language.

Tools

  • POC - Prototype objects container
  • Tester - Testing tool

Tests for tools

To run tests simply execute script run-all-tests.red from project main directory through Red binary. This script will detect and execute all test files like ***-tests.red under /tests directory.

./red -s run-all-tests.red

Prototype objects container

src/poc.red

Purpose

Ability to store objects safely in a key-value map, with access control and type checking. Currently map! can store anything, so POC will guarantee, that only objects will be stored. Fetching chosen element will return a clone of object prototype.

"Tester" testing tool

src/tester.red

Purpose

Tool for running tests of Red language scripts inspired by PhpUnit, xUnit, nUnit and other similar libraries.

Description

"Tester" expects that you will give him a object!, which will contain test methods. Each test method name should be started with test-. Optionally setup method will be executed before each test separately (only if object! consist method with name setup).

Example:

Red [
    File: %test.red
]

do %src/tester.red

tests: context [
    setup: func [
        "Initialize/Reload context before each test"
    ] [
        do %src/poc.red
    ]

    test-registered-item: func [
        "Testing that item was successfully registered"
    ] [
        book: object [title: "Red cookbook"]
        poc/register "my-book" book
        
        result: poc/registered "my-book"
        tester/assert-true result
    ]
]

tester/run tests

Console output:

./red -s test.red 
--------- Tester ----------
Version 0.0.2

[test] test-registered-item [Success]

Execution time: 0.004187 sec
---------------------------

particles's People

Contributors

koksyn avatar

Watchers

 avatar  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.