xgo/runtime/vm_float_test.go
Daniel 61890b15cb
module refactor (#148)
* wip

* move print and JSON functions to modules

* builtin functions are not replacable now

* builtin functions are added for default nil symbol table

* importables: builtin modules and source modules

* refactoring runtime tests

* fix tests

* update documentation

* cleanup

* clean up cli

* fix REPL prints
2019-03-18 08:15:26 -07:00

15 lines
351 B
Go

package runtime_test
import (
"testing"
)
func TestFloat(t *testing.T) {
expect(t, `out = 0.0`, nil, 0.0)
expect(t, `out = -10.3`, nil, -10.3)
expect(t, `out = 3.2 + 2.0 * -4.0`, nil, -4.8)
expect(t, `out = 4 + 2.3`, nil, 6.3)
expect(t, `out = 2.3 + 4`, nil, 6.3)
expect(t, `out = +5.0`, nil, 5.0)
expect(t, `out = -5.0 + +5.0`, nil, 0.0)
}