aboutsummaryrefslogtreecommitdiff
/**
 * There was an incorrect sort behaviour documented in issue #143:
 * (x = f(…)) <= x → x >= (x = f(…))
 *
 * For example, let the equation be:
 * (a = parseInt('100')) <= a
 *
 * If a was an integer and has the value of 99,
 * (a = parseInt('100')) <= a → 100 <= 100 → true
 *
 * When transformed incorrectly:
 * a >= (a = parseInt('100')) → 99 >= 100 → false
 */

tranformation_sort_order_equal: {
    options = {
        comparisons: true,
    }

    input: { (a = parseInt('100')) == a }
    expect: { (a = parseInt('100')) == a }
}

tranformation_sort_order_unequal: {
    options = {
        comparisons: true,
    }

    input: { (a = parseInt('100')) != a }
    expect: { (a = parseInt('100')) != a }
}

tranformation_sort_order_lesser_or_equal: {
    options = {
        comparisons: true,
    }

    input: { (a = parseInt('100')) <= a }
    expect: { (a = parseInt('100')) <= a }
}
tranformation_sort_order_greater_or_equal: {
    options = {
        comparisons: true,
    }

    input: { (a = parseInt('100')) >= a }
    expect: { (a = parseInt('100')) >= a }
}
lspan='3' class='logmsg'> * guix/import/elm.scm, guix/scripts/import/elm.scm: New files. * Makefile.am (MODULES): Add them. * guix/scripts/import.scm (importers): Add "elm". * doc/guix.texi (Invoking guix import): Document Elm importer. * doc/contributing.texi (Elm Packages): Mention it. * tests/elm.scm ("(guix import elm)"): New test group. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2022-05-22guix: Add elm-build-system.Philip McGrath * gnu/packages/patches/elm-offline-package-registry.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/elm.scm (elm): Use it. * guix/build-system/elm.scm, guix/build/elm-build-system.scm, tests/elm.scm: New files. * Makefile.scm (MODULES, SCM_TESTS): Add them. * doc/guix.texi (Build Systems): Document 'elm-build-system'. * doc/contributing.texi (Elm Packages): New section. Document naming conventions and utilities. Signed-off-by: Ludovic Courtès <ludo@gnu.org>