jubianchi / atoum.js

The modern, simple and intuitive PHP 5.3+ unit testing framework, now for JS
http://jubianchi.fr/atoum.js
16 stars 3 forks source link

Add integer asserter #10

Open Nicolab opened 11 years ago

jubianchi commented 11 years ago

:+1:

please could you add the related unit test ? :pray: :wink:

Nicolab commented 11 years ago

Slim, is impossible in this context because if (float)n.0 (eg: 1.0) this.value = (int)1. :frowning:

Example: this.integer(1.0); // this pass because this.value passed in the asserter is 1 (int)

Therefore is also impossible in this context to create the asserter float(1.0)

Nicolab commented 11 years ago

It's a subtlety of the javascript ...

A loony idea :

Until something better, this can be is a patch if there is no simple solution