Skip to content

Commit 6326ab0

Browse files
authored
Merge pull request moonbitlang#443 from moonbitlang/hongbo/add_overflow_test
Add int overflow test
2 parents abb613c + 7c8db25 commit 6326ab0

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

int/int_test.mbt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2024 International Digital Economy Academy
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
test "overflow" {
16+
// signed integer expected to be negative
17+
inspect(0xC2B2AE3D, content="-1028477379")?
18+
inspect(0x85EBCA77, content="-2048144777")?
19+
}

0 commit comments

Comments
 (0)