metafacture / metafacture-fix

Work in progress towards an implementation of the Fix language for Metafacture
Apache License 2.0
6 stars 2 forks source link

Use the default option as in catmandu #333 #356

Closed TobiasNx closed 1 month ago

TobiasNx commented 5 months ago

Resolves #333.

TobiasNx commented 2 months ago

@blackwinter could you help me how I would continue here? I would suggest to drop the _default version of metamorph.

blackwinter commented 1 month ago

I've changed the default handling according to our last discussion:

(27634d1)

Still needs tests and documentation.

TobiasNx commented 1 month ago

@blackwinter I added tests and tried them locally but they still seem to fail:

MetafixLookupTest > shouldUseDefaultOptionValueIfNotFound() STANDARD_ERROR
    [Test worker] WARN org.metafacture.metafix.validation.XtextValidator - The FixStandaloneSetup file '/tmp/metafix1977380759175164437.fix' has 1 issue:
    [Test worker] WARN org.metafacture.metafix.validation.XtextValidator - - ERROR: no viable alternative at input 'default' (2:28)

MetafixLookupTest > shouldUseDefaultOptionValueIfNotFound() FAILED
    org.metafacture.metafix.FixParseException: Invalid FixStandaloneSetup resource: /tmp/metafix1977380759175164437.fix
        at app//org.metafacture.metafix.validation.XtextValidator.getValidatedResource(XtextValidator.java:73)
        at app//org.metafacture.metafix.FixStandaloneSetup.parseFix(FixStandaloneSetup.java:31)
        at app//org.metafacture.metafix.FixStandaloneSetup.parseFix(FixStandaloneSetup.java:36)
        at app//org.metafacture.metafix.Metafix.getRecordTransformer(Metafix.java:205)
        at app//org.metafacture.metafix.Metafix.<init>(Metafix.java:119)
        at app//org.metafacture.metafix.MetafixTestHelpers.fix(MetafixTestHelpers.java:151)
        at app//org.metafacture.metafix.MetafixTestHelpers.assertFix(MetafixTestHelpers.java:133)
        at app//org.metafacture.metafix.MetafixTestHelpers.assertFix(MetafixTestHelpers.java:112)
        at app//org.metafacture.metafix.MetafixLookupTest.shouldUseDefaultOptionValueIfNotFound(MetafixLookupTest.java:643)
blackwinter commented 1 month ago

Could it be that default is a reserved keyword and needs to be quoted (like var)?

TobiasNx commented 1 month ago

I adde @fsteeg for code review