Changeset 40062 in project


Ignore:
Timestamp:
04/26/21 11:46:16 (3 months ago)
Author:
felix winkelmann
Message:

mdh: added more tests, suggested by Luke

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/mdh/trunk/tests/a.scm

    r40054 r40062  
    2727(test "order 2" "4" (global-next g1 1 2 3))
    2828(test "order 3" "" (global-next g1 1))
     29(test "order 3.5" "2" (global-next g1 1 ""))
    2930(test "order 4" "3" (global-previous g1 1 2 4))
    3031(test "order 5" "1" (^next 'g1))
     
    3839(test "kill" #f (global-data g1 1 2 3))
    3940
     41;; further tests by cobax:
     42;; tests ported from mdh manual section 9.1.3.16 Order()
     43;; https://www.cs.uni.edu/~okane/source/MUMPS-MDH/MDH.pdf page 31
     44;; given:
     45(set! (^ "o" 1) "")
     46(set! (^ "o" 1 10) "")
     47(set! (^ "o" 1 20) "")
     48(set! (^ "o" 5 1) "")
     49(set! (^ "o" 5 2) "") ; mdh manual misprinted the 2 as a 5: test("5","5") ="";
     50
     51;; Then Order() will return the following values:
     52(set! go (global "o"))
     53(test "order ex 1" "1" (global-next go ""))       ; test().Order(1)         yields "1"
     54(test "order ex 2" "10" (global-next go 1 "")) ; test("1","").Order(1)   yields "10"
     55(test "order ex 3" "20" (global-next go 1 10)) ; test("1","10").Order(1) yields 20
     56(test "order ex 4" "" (global-next go 1 20))   ; test("1","20").Order(1) yields "" (empty string)
     57(test "order ex 5" "5" (global-next go 1))     ; test("1").Order(1)      yields "5"
     58(test "order ex 6" "1" (global-next go 5 ""))  ; test("5","").Order(1)   yields "1"
     59(test "order ex 7" "2" (global-next go 5 1))   ; test("5","1").Order(1)  yields "2"
     60(test "order ex 8" "" (global-next go 5 2))    ; test("5","2").Order(1)  yields "" (empty string)
     61(test "order ex 9" "" (global-next go 5))      ; test("5").Order(1)      yields "" (empty string)
     62
    4063(test-end)
    4164(test-exit)
Note: See TracChangeset for help on using the changeset viewer.