mabdi / small-amp

Test Amplification for Pharo
MIT License
5 stars 4 forks source link

Error Literal mutation #87

Open mabdi opened 4 years ago

mabdi commented 4 years ago

Literal mutating ff parameters: #(1 2) has versions like ff parameters: #(1 SmallInteger maxVal) which is not acceptable.

mabdi commented 4 years ago

method:

testFunctionFit
    | ff ar p |
    ff := PMFunctionFit function: f data: d.
    ar := ff parameters.
    ar
        do: [ :i | 
            self assert: i isNumber.
            self assert: i ~= 0 ].
    ff parameters: #(1 2).
    self assert: ff parameters equals: #(1 2).
    p := PMWeightedPoint point: -2 @ 1.
    self shouldnt: [ ff accumulate: p ] raise: Error.   "function result will be NaN and should be ignored in the following calculations"
    ff parameters: ar.
    ff evaluate.
    self assert: (ff parameters equalsTo: #(2 0.4))

from PolyMath