tarantool / tarantool/luatest

[Raw idea] Implement Power asserts

Open
#413 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
41
Forks
13
PR merge metrics
No merged PRs in 30d

Description

There is a so-called "Power assertions" that makes assertions quite more powerful. The best way to demonstrate power assertion is an example:

    assert(types[index].name === bob.name)
           |    ||      |    |   |   |
           |    ||      |    |   |   "bob"
           |    ||      |    |   Person{name:"bob",age:5}
           |    ||      |    false
           |    |11     "alice"
           |    Person{name:"alice",age:3}
           ["string",98.6,true,false,null,undefined,#Array#,#Object#,NaN,Infinity,/^not/,#Person#]
  
    --- [string] bob.name
    +++ [string] types[index].name
    @@ -1,3 +1,5 @@
    -bob
    +alice

Power assertions in other languages: Kotlin ^1, Rust ^2, .NET ^3, Ruby ^4, Javasctipt ^5, Grooyv ^6.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by comparing the linked power-assert implementations with the JavaScript example and defining the intended luatest behavior. Done means the project has an agreed scope for power assertions and tests covering the diagnostic output.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.