2019-01-11 13:27:28 +03:00
|
|
|
package runtime_test
|
2019-01-10 13:45:20 +03:00
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestChar(t *testing.T) {
|
2019-03-18 18:15:26 +03:00
|
|
|
expect(t, `out = 'a'`, nil, 'a')
|
|
|
|
expect(t, `out = '九'`, nil, rune(20061))
|
|
|
|
expect(t, `out = 'Æ'`, nil, rune(198))
|
2019-02-02 03:58:44 +03:00
|
|
|
|
2019-03-18 18:15:26 +03:00
|
|
|
expect(t, `out = '0' + '9'`, nil, rune(105))
|
|
|
|
expect(t, `out = '0' + 9`, nil, '9')
|
|
|
|
expect(t, `out = '9' - 4`, nil, '5')
|
|
|
|
expect(t, `out = '0' == '0'`, nil, true)
|
|
|
|
expect(t, `out = '0' != '0'`, nil, false)
|
|
|
|
expect(t, `out = '2' < '4'`, nil, true)
|
|
|
|
expect(t, `out = '2' > '4'`, nil, false)
|
|
|
|
expect(t, `out = '2' <= '4'`, nil, true)
|
|
|
|
expect(t, `out = '2' >= '4'`, nil, false)
|
|
|
|
expect(t, `out = '4' < '4'`, nil, false)
|
|
|
|
expect(t, `out = '4' > '4'`, nil, false)
|
|
|
|
expect(t, `out = '4' <= '4'`, nil, true)
|
|
|
|
expect(t, `out = '4' >= '4'`, nil, true)
|
2019-01-10 13:45:20 +03:00
|
|
|
}
|