Commit 162c811
authored
Stop using langversion <= 7 in tests (#19223)
* Migrate StaticClassTests.fs from withLangVersion70 to withLangVersion80
Updated all 25 test configurations to use withLangVersion80 instead of
withLangVersion70. This is part of the test suite migration to require
minimum language version 8.0.
* Migrate ErrorMessages tests from withLangVersionXX to withLangVersionPreview
Migrated all ErrorMessages test files to use withLangVersionPreview instead of
withLangVersion70/60/50/47/46. Updated test expectations where behavior differs
between old language versions and preview.
Files changed:
- WarnExpressionTests.fs
- ClassesTests.fs
- IndexingSyntax.fs
- ModuleTests.fs
- ConstructorTests.fs
- UnionCasePatternMatchingErrors.fs
- NameResolutionTests.fs
- WarnIfDiscardedInList.fs
* Migrate Language test files: replace withLangVersionXX with withLangVersionPreview
- Delete negative version gate tests that check 'Feature not available in F# 7.0' errors
- Migrate positive tests from withLangVersion50/70 to withLangVersionPreview
- Files: CodeQuotationTests, InterfaceTests, NameofTests, CopyAndUpdateTests,
DotLambdaTests, PrintfFormatTests, AttributeCheckingTests, ExtensionMethodTests
* Migrate ComponentTests/Interop tests to langVersion80
- RequiredAndInitOnlyProperties.fs: 15 withLangVersion70 -> withLangVersion80
- StaticsInInterfaces.fs: 8 withLangVersion70 -> withLangVersion80
- VisibilityTests.fs: 4 withLangVersion70 + 4 withLangVersion50 -> withLangVersion80
* Migrate Conformance tests to withLangVersion80
- Remove old langversion tests (46, 47, 50, 60, 70) from Conformance files
- Delete version-specific tests that test obsolete behavior:
- RelaxWhitespace2_Indentation (F# 6.0 specific)
- RelaxWhitespace2_Fs50 (F# 5.0 specific, ~4700 lines)
- Static type parameter inference in version 6
- LowercaseWhenRequireQualifiedAccess_fs in langversion 6
- Update remaining tests to use withLangVersion80
- Delete obsolete negative version tests in StaticLet, ErrorMessages, Language
* Migrate ComponentTests Diagnostics and Miscellaneous to langversion 8.0
- Records.fs: withLangVersion70 -> withLangVersion80
- ListLiterals.fs: Remove langversion 6.0 test, update 7.0 -> 8.0
- MigratedTypeCheckTests.fs: LangVersion.V50/V60/V70 -> V80
- FsharpSuiteMigrated.fs: Remove obsolete V47/V50/V60/V70 from adjustVersion
- MigratedCoreTests.fs: LangVersion.V50/V70 -> V80
- Add test-langversion-8.0.fsx/.bsl for array-no-dot-warnings
* Migrate ComponentTests EmittedIL files to langversion80
Migrated 4 files:
- SerializableAttribute.fs: withLangVersion60 -> withLangVersion80 (2 occurrences)
- TestFunctions.fs: withLangVersion70 -> withLangVersion80
- Literals.fs: Converted version-gate test to check success with 8.0
- MethodImplAttribute.fs: Removed redundant F# 7 version-gate test
* Migrate tests/fsharp small files to langversion 8.0
- SignatureGenerationTests.fs: withLangVersion50 → withLangVersion80
- NullableOptionalRegressionTests.fs: withLangVersion50 → withLangVersion80
- WitnessTests.fs: withLangVersion50 → withLangVersion80
- ForInDoMutableRegressionTest.fs: --langversion:5.0 → --langversion:8.0
- ComparisonTests.fs: --langversion:5.0 → --langversion:8.0
- StringFormatTests.fs: --langversion:5.0 → --langversion:8.0
* Migrate OpenTypeDeclarationTests.fs to langversion 8.0
- Replace all withLangVersion50 with withLangVersion80
- Delete 5 test cases that use withLangVersion46 (negative version gate tests)
- Update raw --langversion:5.0 strings to --langversion:8.0
- Update targetVersion literal from "5.0" to "8.0"
* Migrate DefaultInterfaceMemberTests.fs to langversion 8.0
- Remove DefaultInterfaceMemberConsumptionTests_LanguageVersion_4_6 module
(langversion 4.6 negative version gate tests are obsolete)
- Remove DefaultInterfaceMemberConsumptionTests_LanguageVersion_4_6_net472 module
- Remove DefaultInterfaceMemberConsumptionTests_net472 module
- Replace all --langversion:5.0 with --langversion:8.0 in remaining tests
- Reduces file from 4953 to 3878 lines
* Migrate remaining tests/fsharp/Compiler/Language files to langversion 8.0
- Delete FixedIndexSliceTests.fs (all tests were version gate tests for 4.7)
- Delete version gate test from StructActivePatternTests.fs
- Delete version gate test from InterfaceTests.fs
- Delete version gate tests from StringInterpolation.fs
- Update all --langversion:5.0 to --langversion:8.0
* Migrate fsharpqa env.lst files to langversion 8.0
Updated 12 env.lst files to replace --langversion:4.X/5.X/6.X/7.X
with --langversion:8.0. Deleted obsolete tests that specifically
tested old version failures:
- Deleted version46/ tests in SequenceExpressions
- Deleted E_MultipleInst*.4.7.fs files in InterfaceTypes
- Deleted E_*4.7.fs files for interface consumption tests
- Deleted E_ObjExprWithSameInterface01.4.7.fs
The CompilerOptions/fsi/langversion/env.lst is preserved as it tests
INVALID version handling.
* Migrate tests/fsharp/tests.fs to langversion 8.0+
- Delete subtype-langversion-46 test (used langversion 4.6)
- Delete printing-langversion47 test (used langversion 4.7)
- Delete libtest-langversion-46 test (used langversion 4.6)
- Update sigs pos40 test from langversion 6.0 to 8.0
- C# langversion:7.2 flags unchanged (C# version, not F#)
* Remove obsolete F# 4.6/4.7 langversion tests from tests.fs
- Delete langversion 4.7 test block and baseline file from fsfromfsviacs test
- Remove member-selfidentifier-version4_6/4_7 tests and directories
- Remove indent-version4_7 test and related directories
- Remove nameof-version4_6 test and directory
- Remove type check neg24 version 4_6/4_7 tests and directories
These tests are obsolete since F# 8.0 is now the minimum supported version.
* Migrate FSharp.Compiler.Service.Tests to langversion 8.0
- Rename parseAndCheckScript50/70 to parseAndCheckScript80 in Common.fs
- Rename getParseAndCheckResults50/70 to getParseAndCheckResults80 in Common.fs
- Update all callers in ExprTests.fs and PatternMatchCompilationTests.fs
- Replace --langversion:7.0 with --langversion:8.0 in ExprTests.fs
* Fix PatternMatchCompilationTests expected diagnostics after langversion 8.0 migration
- As 12/18: Remove duplicate diagnostic lines
- As 20: Update expected diagnostic to match F# 8.0 behavior where the
'non-variable patterns to the right of as patterns' feature is now available
* Migrate Scripting tests: LangVersion.V47 -> V80
* Migrate Conformance tests langversion strings from pre-8.0 to 8.0
- BasicConstants.fs: Update 4 occurrences of --langversion:5.0 to 8.0
- ComputationExpressions.fs: Update 1 occurrence of /langversion:4.7 to 8.0
* Remove obsolete langversion helpers (46/47/50/60/70) from test infrastructure
- Remove withLangVersion46/47/50/60/70 helper functions from Compiler.fs
- Remove LangVersion.V47/V50/V60/V70 enum values from ScriptHelpers.fs
- Update langversion tests to use 8.0 instead of 5.0
- Remove v7.0 PropertyShadowing tests (feature always available in 8.0+)
- Remove UseBindings Bad LangVersion test (5.0 no longer supported)
- Update InvalidNumericLiteralTests FSI script to use langversion 8.0
All remaining langversion:(4.|5.|6.|7.) matches are either:
- C# langversion (csc commands)
- Invalid-version test files
- Comments or baseline files
* bunch of tests moved
* Update OptionalInteropTests langversion from 5.0 to 8.0
* Add DELETION_EXPLANATION.md for core test files audit
Analyzes the 6 deleted files in tests/fsharp/core/ as part of the
LangVersion 8.0+ migration:
- indent/version46/test.fsx (Category B - superseded)
- indent/version47/test.fsx (Category B - superseded)
- members/self-identifier/version46/test.fs (Category A - error test)
- members/self-identifier/version47/test.fs (Category B - superseded)
- nameof/version46/test.fsx (Category A - error test)
- fsfromfsviacs/compilation.langversion.old.output.bsl (Category A)
All deletions are justified - no Category C or D issues found.
* Audit deleted typecheck/sigs version tests (4 files)
Add analysis for the 4 deleted files in tests/fsharp/typecheck/sigs/version46/
and version47/:
- neg24.fs (version46): FS0035 deprecated warnings - now handled by main neg24.fs
- neg24.bsl (version46): Baseline with deprecated errors no longer applicable
- neg24.fs (version47): Implicit yield tests - content now in main neg24.fs
- neg24.bsl (version47): Baseline now used by main neg24.bsl
All 4 files are Category B (superseded by retained counterpart). The main
neg24.fs contains the version47 content testing implicit yield behavior,
which is now the baseline for 8.0+ langversion.
* Audit FixedIndexSliceTests.fs deletion
Document the complete deletion of tests/fsharp/Compiler/Language/FixedIndexSliceTests.fs:
- Category A deletion: Tests only verified 3D/4D slicing was NOT available in langversion 4.7
- Feature (Fixed-index slice) was introduced in F# 5.0 preview
- Verified comprehensive coverage exists elsewhere:
- Slices05.fs (conformance tests with 150+ lines of slicing tests)
- Array3Module.fs (slicing unit tests)
- Array4Module.fs (slicing unit tests)
- core/array/test.fsx (runtime slicing tests)
No coverage gap - the feature has extensive positive test coverage.
* Audit fsharpqa InterfaceTypes 4.7 deletions
Analyzed 7 deleted InterfaceTypes files that tested 'interfaces with
multiple generic instantiation' errors:
- E_MultipleInst01.4.7.fs
- E_MultipleInst04.4.7.fs
- E_MultipleInst07.4.7.fs
- E_ImplementGenIFaceTwice01_4.7.fs
- E_ImplementGenIFaceTwice02_4.7.fs
- E_ConsumeMultipleInterfaceFromCS.4.7.fs
- E_ClassConsumeMultipleInterfaceFromCS.4.7.fs
All 7 are Category A (safe deletions) - they only tested FS3350
'feature not available in F# 4.7' errors. All have retained 5.0+
counterparts that test successful feature usage or semantic errors.
* Audit fsharpqa ObjectExpressions and SequenceExpressions deletions
Document the deletion justification for 4 fsharpqa conformance files:
- ObjectExpressions/E_ObjExprWithSameInterface01.4.7.fs (Category A)
- SequenceExpressions/version46/W_IfThenElse01.fs (Category B)
- SequenceExpressions/version46/W_IfThenElse02.fs (Category B)
- SequenceExpressions/version46/W_IfThenElse03.fs (Category B)
All deletions are safe:
- The 4.7 ObjectExpressions file only tested FS3350 'feature not available';
the 5.0 counterpart tests the real FS3361 'may unify' semantic error
- The version46 SequenceExpressions files tested FS0035 'deprecated' warnings
that were replaced by implicit yield in F# 4.7; version47 counterparts retained
* Audit DefaultInterfaceMemberConsumptionTests_LanguageVersion_4_6 module deletion
- Document that ~1070 lines deleted from DefaultInterfaceMemberTests.fs
- Verify FS3350 version gate tests are Category A (safe to delete)
- Confirm DIM consumption is positively tested at 8.0+ (33 Runs + 46 Errors tests)
- No coverage gap: feature has comprehensive test coverage at 8.0
* Audit OpenTypeDeclarationTests.fs deletions
Document the 5 deleted langversion:4.6 tests in OpenTypeDeclarationTests.fs:
- OpenSystemMathOnce, OpenSystemMathTwice, OpenMyMathOnce
- DontOpenAutoMath, OpenAutoMath
All deleted tests fall into Category A (FS3350 'feature not available') or
Category B (superseded by retained 8.0 counterpart). The open type declaration
feature is thoroughly tested at langversion 8.0 with 40+ test scenarios covering
nested types, generics, measures, enums, and error cases.
* Audit StringInterpolation and StructActivePattern deletions
Document 3 deleted test cases:
- '%B fails for langVersion 5.0' (StringInterpolation.fs)
- 'Basic string interpolation (4.7)' (StringInterpolation.fs)
- 'Struct active pattern (-langversion:5.0)' (StructActivePatternTests.fs)
All are Category A (version gate error message tests) - safe to delete
as they only tested FS3350 'feature not available' errors that are
pointless once older langversions are unsupported.
* Add StaticClassTests.fs deletion audit to DELETION_EXPLANATION.md
Audited all deleted 'lang version70' tests from StaticClassTests.fs.
Confirmed each deleted test has a retained counterpart at 8.0/preview:
- 24+ tests consolidated from version70/preview pairs to single tests
- All deletions are Category B (superseded by retained counterpart)
- No test coverage gap exists
- Test naming improved by removing version suffixes
* Complete StaticClassTests audit - add 4 missing deleted test entries
* Audit ComponentTests Language folder deletions
Add audit section for 5 deleted tests from ComponentTests/Language:
- CopyAndUpdateTests.fs: 'Cannot use nested copy-and-update in lang version70'
- DotLambdaTests.fs: 'ToString with F# 7'
- PrintfFormatTests.fs: 'Non-inline literals cannot be used as printf format in lang version70'
- InterfaceTests.fs: 'Concrete static members are not allowed in interfaces in lang version70'
- ExtensionMethodTests.fs: No deletions, only version migrations
All tests were Category A (testing version gate errors only).
* Audit tests.fs deletions - document ~10 deleted test cases
Added comprehensive analysis of deleted tests.fs test cases:
- subtype-langversion-46 (Category B - superseded)
- fsfromfsviacs langversion compilation (Category A - version gate)
- printing-langversion47 (Category B - identical behavior)
- libtest-langversion-46 (Category B - superseded)
- member-selfidentifier-version4_6/4_7 (Categories A/B)
- indent-version4_7 (Category B - superseded)
- nameof-version4_6 (Category A - version gate)
- type check neg24 version 4_6/4_7 (Category B - superseded)
All ~10 deletions are safe:
- 4 Category A: testing unavailability in old versions
- 6 Category B: superseded by retained tests
- No coverage gaps identified
* Add executive summary section to DELETION_EXPLANATION.md
- Add summary at top with total deletion counts (22 files, 74 entries)
- Document Category A (27) and Category B (47) distribution
- Confirm zero Category C/D issues requiring investigation
- Cross-reference all 22 deleted files against git diff
* Update env.lst
* further cleanups
* Clean up .ralph artifacts, DELETION_EXPLANATION.md, and LANGVERSION_IN_TESTS_MIGRATION.md
* Fix CI test failures for langversion 8.0 migration
- FixIndexerAccessLegacyTests: Fix squiggly from 'list[2]' to '[2]'
- OpenTypeDeclarationTests: Update error code from 1 to 193
- neg132.bsl: Remove obsolete FS3510 langversion error
- neg02.vsbsl: Remove FS3350 langversion error, add duplicate parse errors
- E_QuoteDynamic01: Remove test (quotations with member constraints work in v8)
- E_ConsumeMultipleInterfaceFromCS.5.0: Remove test (feature now allowed in v8)
- E_MemberConstraint02/04, E_UnmanagedConstraint01, E_EqualityConstraint01,
E_ComparisonConstraint01: Update error code from FS0001 to FS0193
- DefaultConstructorConstraint02: Update error code from FS0001 to FS0071
- E_Abbreviation.fsx: Update error message text
- E_RigidTypeAnnotation02_5_0.fsx: Remove no longer produced error
* Remove temp analysis file
* Remove duplicate LangVersion60 SerializableAttribute tests
These tests were identical to ToplevelModule_fs and ToplevelNamespace_fs after
the branch changed withLangVersion60 to withLangVersion80. The source files
(ToplevelModule60.fs, ToplevelNamespace60.fs) were exact duplicates of the
non-60 versions, making these tests redundant.
* Remove orphan version-suffixed test files
- test-langversion-5.0.fsx/bsl: Identical to 8.0 version, not run by any test
- E_ConsumeMultipleInterfaceFromCS.5.0.fs: Commented out in env.lst, multiple
interface instantiation now works in langversion 8.0+
* Fix remaining CI test failures
- neg20 version 8_0: Remove duplicate test, delete version50 folder
- FixIndexerAccessLegacyTests: Revert squiggly to 'list[2]' (not '[2]')
- E_MemberConstraint04.fs: Use regex . for embedded newlines in --flaterrors
* Fix FixIndexerAccessLegacyTests - squiggly must end before bracket
The codefix expands forward from span to find '[' then appends '.'.
If span includes '[', it expands past end of line and produces wrong output.
Changed variable name to 'xs' (unique) and squiggly to 'xs' (ends before '[').
* Update E_MemberConstraint04.fs
* Fix FixIndexerAccessLegacyTests with unique squiggly
Use '= myList' as squiggly - unique to line 2 and ends before '['.
The codefix expands forward to find '[' then appends '.' to the span.1 parent d795504 commit 162c811
File tree
145 files changed
+683
-41577
lines changed- tests
- FSharp.Compiler.ComponentTests
- CompilerOptions/fsc
- Conformance
- BasicGrammarElements
- MemberDefinitions/MethodsAndProperties
- StaticLet
- UseBindings
- InferenceProcedures/RecursiveSafetyAnalysis
- LexicalFiltering/OffsideExceptions
- PatternMatching/As
- Types
- TypeConstraints/IWSAMsAndSRTPs
- UnionTypes
- Diagnostics
- EmittedIL
- FixedBindings
- MethodImplAttribute
- SerializableAttribute
- TestFunctions
- ErrorMessages
- Interop
- Language
- FixedBindings
- Miscellaneous
- TypeChecks
- TypeExtensions
- FSharp.Compiler.Private.Scripting.UnitTests
- FSharp.Compiler.Service.Tests
- FSharp.Test.Utilities
- fsharpqa/Source
- Conformance
- DeclarationElements/ObjectConstructors
- Expressions
- DataExpressions
- ComputationExpressions
- NameOf
- ObjectExpressions
- SequenceExpressions
- version46
- ExpressionQuotations/Regressions
- ImplementationFilesAndSignatureFiles/NamespacesFragmentsAndImplementationFiles/global
- InferenceProcedures/NameResolution/RequireQualifiedAccess
- ObjectOrientedTypeDefinitions/InterfaceTypes
- TypesAndTypeConstraints/CheckingSyntacticTypes
- Diagnostics/NONTERM
- fsharp
- Compiler
- Conformance
- BasicGrammarElements
- DataExpressions
- Language
- Libraries/Core/LanguagePrimitives
- Regressions
- Service
- core
- array-no-dot-warnings
- fsfromfsviacs
- indent
- version46
- version47
- members/self-identifier
- version46
- version47
- nameof/version46
- typecheck/sigs
- version46
- version47
- version50
- vsintegration/tests/FSharp.Editor.Tests/CodeFixes
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
145 files changed
+683
-41577
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | 270 | | |
272 | 271 | | |
273 | 272 | | |
| |||
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
320 | | - | |
321 | 319 | | |
322 | 320 | | |
323 | 321 | | |
| |||
472 | 470 | | |
473 | 471 | | |
474 | 472 | | |
475 | | - | |
476 | 473 | | |
477 | 474 | | |
478 | 475 | | |
| |||
548 | 545 | | |
549 | 546 | | |
550 | 547 | | |
551 | | - | |
552 | 548 | | |
553 | 549 | | |
554 | 550 | | |
| |||
623 | 619 | | |
624 | 620 | | |
625 | 621 | | |
626 | | - | |
627 | | - | |
628 | 622 | | |
629 | 623 | | |
630 | 624 | | |
| |||
670 | 664 | | |
671 | 665 | | |
672 | 666 | | |
673 | | - | |
674 | 667 | | |
675 | 668 | | |
676 | 669 | | |
| |||
713 | 706 | | |
714 | 707 | | |
715 | 708 | | |
716 | | - | |
717 | 709 | | |
718 | 710 | | |
719 | 711 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| |||
Lines changed: 0 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 6 | | |
28 | 7 | | |
29 | | - | |
30 | 8 | | |
31 | 9 | | |
32 | 10 | | |
| |||
40 | 18 | | |
41 | 19 | | |
42 | 20 | | |
43 | | - | |
44 | 21 | | |
45 | 22 | | |
46 | 23 | | |
| |||
54 | 31 | | |
55 | 32 | | |
56 | 33 | | |
57 | | - | |
58 | 34 | | |
59 | 35 | | |
60 | 36 | | |
| |||
137 | 113 | | |
138 | 114 | | |
139 | 115 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | 116 | | |
149 | 117 | | |
150 | 118 | | |
| |||
Lines changed: 2 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 20 | | |
31 | 21 | | |
32 | 22 | | |
33 | 23 | | |
34 | | - | |
| 24 | + | |
35 | 25 | | |
36 | 26 | | |
37 | 27 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments