-
Notifications
You must be signed in to change notification settings - Fork 894
Open
Description
Issue
When i sort the floating numbers by list js sort function, there is some problem.
Problem
I find some problem in sort.test.js code.
The test data is incomplete. That test should be compensated by using another test data.
Suggestion
Here is what i suggested.
...
// my suggestion
it('should show order of sorted floates (a bit wrong)', function () {
i1.values({ val: '0.5' })
i2.values({ val: '0.26' })
i3.values({ val: '0.040' })
i4.values({ val: '0.50' })
i5.values({ val: '0.500' })
i6.values({ val: '0.3' })
list.sort('val', { order: 'asc' })
expect(list.items[0].values().val).toBe('0.040')
expect(list.items[1].values().val).toBe('0.26')
expect(list.items[2].values().val).toBe('0.3')
expect(list.items[3].values().val).toBe('0.5')
expect(list.items[4].values().val).toBe('0.50')
expect(list.items[5].values().val).toBe('0.500')
})
...Test result
list jssort floating number by..- So when
list jscompare0.5and0.26,0.26is bigger than0.5becauselist jsrecognize0.5to5and0.26to26.
nbt-leejaewon
Metadata
Metadata
Assignees
Labels
No labels