2019-01-11 13:27:28 +03:00
|
|
|
package runtime_test
|
2019-01-09 10:17:42 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestBangOperator(t *testing.T) {
|
2019-03-18 18:15:26 +03:00
|
|
|
expect(t, `out = !true`, nil, false)
|
|
|
|
expect(t, `out = !false`, nil, true)
|
|
|
|
expect(t, `out = !0`, nil, true)
|
|
|
|
expect(t, `out = !5`, nil, false)
|
|
|
|
expect(t, `out = !!true`, nil, true)
|
|
|
|
expect(t, `out = !!false`, nil, false)
|
|
|
|
expect(t, `out = !!5`, nil, true)
|
2019-01-09 10:17:42 +03:00
|
|
|
}
|