-
Notifications
You must be signed in to change notification settings - Fork 790
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #5729 and add first batch of tests.
- Loading branch information
1 parent
d5f5bd0
commit d5c12e0
Showing
6 changed files
with
97 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/E_MaxLiterals04.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// #Regression #Conformance #LexicalAnalysis #Constants | ||
|
||
|
||
// Verify compile error for signed literals which are MaxSize + 1, MaxSize - 1 | ||
// All of these should cause compiler errors | ||
|
||
//<Expects id="FS1142" status="error">This number is outside the allowable range for 8-bit signed integers</Expects> | ||
//<Expects id="FS1145" status="error">This number is outside the allowable range for 16-bit signed integers</Expects> | ||
//<Expects id="FS1147" status="error">This number is outside the allowable range for 32-bit signed integers</Expects> | ||
//<Expects id="FS1149" status="error">This number is outside the allowable range for 64-bit signed integers</Expects> | ||
|
||
//<Expects id="FS1142" status="error">This number is outside the allowable range for 8-bit signed integers</Expects> | ||
//<Expects id="FS1145" status="error">This number is outside the allowable range for 16-bit signed integers</Expects> | ||
//<Expects id="FS1147" status="error">This number is outside the allowable range for 32-bit signed integers</Expects> | ||
//<Expects id="FS1149" status="error">This number is outside the allowable range for 64-bit signed integers</Expects> | ||
|
||
|
||
let minByteBin = -0b10000001y | ||
let maxByteBin = 0b10000000y | ||
|
||
let minInt16Bin = -0b1000_0000_0000_0001s | ||
let maxInt16Bin = 0b1000_0000_0000_0000s | ||
|
||
let minInt32Bin = -0b1000_0000_0000_0000_0000_0000_0000_0001 | ||
let maxInt32Bin = 0b1000_0000_0000_0000_0000_0000_0000_0000 | ||
|
||
let minInt64Bin = -0b1000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0001L | ||
let maxInt64Bin = 0b1000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000L |
28 changes: 28 additions & 0 deletions
28
tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/E_MaxLiterals05.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// #Regression #Conformance #LexicalAnalysis #Constants | ||
|
||
|
||
// Verify compile error for signed literals which are MaxSize + 1, MaxSize - 1 | ||
// All of these should cause compiler errors | ||
|
||
//<Expects id="FS1142" status="error">This number is outside the allowable range for 8-bit signed integers</Expects> | ||
//<Expects id="FS1145" status="error">This number is outside the allowable range for 16-bit signed integers</Expects> | ||
//<Expects id="FS1147" status="error">This number is outside the allowable range for 32-bit signed integers</Expects> | ||
//<Expects id="FS1149" status="error">This number is outside the allowable range for 64-bit signed integers</Expects> | ||
|
||
//<Expects id="FS1142" status="error">This number is outside the allowable range for 8-bit signed integers</Expects> | ||
//<Expects id="FS1145" status="error">This number is outside the allowable range for 16-bit signed integers</Expects> | ||
//<Expects id="FS1147" status="error">This number is outside the allowable range for 32-bit signed integers</Expects> | ||
//<Expects id="FS1149" status="error">This number is outside the allowable range for 64-bit signed integers</Expects> | ||
|
||
|
||
let minByteHex = -0x81y | ||
let maxByteHex = 0x80y | ||
|
||
let minInt16Hex = -0x8001s | ||
let maxInt16Hex = 0x8000s | ||
|
||
let minInt32Hex = -0x8000_0001 | ||
let maxInt32Hex = 0x8000_0000 | ||
|
||
let minInt64Hex = -0x8000_0000_0000_0001L | ||
let maxInt64Hex = 0x8000_0000_0000_0000L |
28 changes: 28 additions & 0 deletions
28
tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/E_MaxLiterals06.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// #Regression #Conformance #LexicalAnalysis #Constants | ||
|
||
|
||
// Verify compile error for signed literals which are MaxSize + 1, MaxSize - 1 | ||
// All of these should cause compiler errors | ||
|
||
//<Expects id="FS1142" status="error">This number is outside the allowable range for 8-bit signed integers</Expects> | ||
//<Expects id="FS1145" status="error">This number is outside the allowable range for 16-bit signed integers</Expects> | ||
//<Expects id="FS1147" status="error">This number is outside the allowable range for 32-bit signed integers</Expects> | ||
//<Expects id="FS1149" status="error">This number is outside the allowable range for 64-bit signed integers</Expects> | ||
|
||
//<Expects id="FS1142" status="error">This number is outside the allowable range for 8-bit signed integers</Expects> | ||
//<Expects id="FS1145" status="error">This number is outside the allowable range for 16-bit signed integers</Expects> | ||
//<Expects id="FS1147" status="error">This number is outside the allowable range for 32-bit signed integers</Expects> | ||
//<Expects id="FS1149" status="error">This number is outside the allowable range for 64-bit signed integers</Expects> | ||
|
||
|
||
let minByteOct = -0o201y | ||
let maxByteOct = 0o200y | ||
|
||
let minInt16Oct = -0o100_001s | ||
let maxInt16Oct = 0o100_000s | ||
|
||
let minInt32Oct = -0o20_000_000_001 | ||
let maxInt32Oct = 0o20_000_000_000 | ||
|
||
let minInt64Oct = -0o1_000_000_000_000_000_000_001L | ||
let maxInt64Oct = 0o1_000_000_000_000_000_000_000L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters