namespace ConsumePlugin open WoofWare.Myriad.Plugins // This file contains test cases for conflict detection in the ArgParser generator. // These are expected to FAIL at build time with appropriate error messages. // Uncomment each section one at a time to test the specific conflict detection. // ============================================================================ // Test 1: Field named NoFooBar conflicts with FooBar's --no- variant // ============================================================================ // Expected error: Argument name conflict: '--no-foo-bar' collides with the --no- variant // of field 'FooBar' (which has []) (* [] type ConflictingFieldNames = { [] FooBar : bool NoFooBar : bool } *) // ============================================================================ // Test 2: ArgumentLongForm "no-foo" conflicts with Foo's --no- variant // ============================================================================ // Expected error: Argument name conflict: '--no-foo' collides with the --no- variant // of field 'Foo' (which has []) (* [] type ConflictingLongForm = { [] Foo : bool [] Bar : bool } *) // ============================================================================ // Test 3: Multiple ArgumentLongForm, one conflicts // ============================================================================ // Expected error: Argument name conflict: '--no-verbose' collides with... (* [] type ConflictingMultipleLongForms = { [] [] [] VerboseMode : bool [] Quiet : bool } *) // ============================================================================ // Test 4: ArgumentNegateWithPrefix on non-boolean field // ============================================================================ // Expected error: [] can only be applied to boolean // or flag DU fields, but was applied to field NotABool of type string (* [] type InvalidAttributeOnNonBool = { [] NotABool : string } *) // ============================================================================ // Test 5: ArgumentNegateWithPrefix on non-flag int field // ============================================================================ // Expected error: [] can only be applied to boolean // or flag DU fields (* [] type InvalidAttributeOnInt = { [] NotAFlag : int } *) // ============================================================================ // Test 6: Complex conflict with custom names // ============================================================================ // This tests a more complex scenario where a custom ArgumentLongForm creates // a conflict with a different field's negated form (* [] type ComplexConflict = { [] [] FeatureA : bool [] DisableAll : bool } *) // ============================================================================ // Test 7: Valid usage - no conflicts (this SHOULD compile) // ============================================================================ [] type NoConflict = { [] EnableFeature : bool [] VerboseMode : bool NormalField : string }