Skip to content

Commit

Permalink
Merge pull request moonbitlang#443 from moonbitlang/hongbo/add_overfl…
Browse files Browse the repository at this point in the history
…ow_test

Add int overflow test
  • Loading branch information
bobzhang authored May 26, 2024
2 parents abb613c + 7c8db25 commit 6326ab0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions int/int_test.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2024 International Digital Economy Academy
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

test "overflow" {
// signed integer expected to be negative
inspect(0xC2B2AE3D, content="-1028477379")?
inspect(0x85EBCA77, content="-2048144777")?
}

0 comments on commit 6326ab0

Please sign in to comment.