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) {
|
|
|
|
expect(t, `out = !true`, false)
|
|
|
|
expect(t, `out = !false`, true)
|
|
|
|
expect(t, `out = !0`, true)
|
|
|
|
expect(t, `out = !5`, false)
|
|
|
|
expect(t, `out = !!true`, true)
|
|
|
|
expect(t, `out = !!false`, false)
|
|
|
|
expect(t, `out = !!5`, true)
|
|
|
|
}
|