Skip to content

Tests #70

Open
Open
@MaanooAk

Description

@MaanooAk

A suggestion for testing (what I am using in jnyan):

tests
├── 001
│   ├── main.nyan
│   └── sim
│       ├── 001.txt
│       └── 002.txt
└── 002
     ├── engine.nyan
     ├── main.nyan
     └── sim
         ├── 001.txt
         └── 002.txt

Where the root folders are test cases with loaded file being the main.nyan (which may include import statements) and in the sim (= simulation) folders there are files with commands in order to simulate a scenario. Every line is command, mainly assert like commands but also execution of patches.

// optionally set a namespace
namespace main

// asserts
Barracks creates	== [main.Jedi, main.Clone]
Barracks hp 		== 4000
Barracks model 		== ./models/m1.dat

// assert number of members
Unit     # 3
Infantry # 3

Jedi   hp  == 300
Master hp  == 480

// apply a patch
patch ArmorUpgrade

Jedi   hp  == 310
Master hp  == 490

Source: jnyan/src/test/resources/tests/000

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions