module list-sort-test
imports libstratego-lib

strategies

  main = 
    test-suite(!"list-sort-test",
      tuple-uniq-tests
      ; qsort-tests
    )

  tuple-uniq-tests =
    apply-test(!"tuple-uniq-test"
    , uniq
    , ![1,2,3,5,3,7,1,4,9,2]
    , ![1,2,3,5,7,4,9]
    )

  qsort-tests = id
    ; apply-test(!"qsort-test"
      , qsort(lt)
      , ![1,2,3,5,3,7,1,4,9,2]
      , ![1,1,2,2,3,3,4,5,7,9]
      )
    ; apply-test(!"qsort-test"
      , qsort(gt)
      , ![1,2,3]
      , ![3,2,1]
      )
    ; apply-test(!"qsort-test"
      , qsort(lt)
      , ![3,2,1]
      , ![1,2,3]
      )
    ; apply-test(!"qsort-test"
      , qsort(lt)
      , ![1,2,3]
      , ![1,2,3]
      )
    ; apply-test(!"qsort-test"
      , qsort(lt)
      , ![1]
      , ![1]
      )
    ; apply-test(!"qsort-test"
      , qsort(lt)
      , ![]
      , ![]
      )



