Skip to content

Commit

Permalink
javve#762 : improve test data for sorting float numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
xi-jjun committed Jun 3, 2023
1 parent 52aa6ac commit 6db40c2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions __test__/sort.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,19 @@ describe('Sort', function () {
expect(list.items[5].values().val).toBe('my.string_41299.tif')
})
it('should show order of sorted floates (a bit wrong)', function () {
i1.values({ val: '10.0401' })
i2.values({ val: '10.022' })
i3.values({ val: '10.021999' })
i4.values({ val: '11.231' })
i5.values({ val: '0003.123' })
i6.values({ val: '09.2123' })
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('0003.123')
expect(list.items[1].values().val).toBe('09.2123')
expect(list.items[2].values().val).toBe('10.022')
expect(list.items[3].values().val).toBe('10.0401')
expect(list.items[4].values().val).toBe('10.021999')
expect(list.items[5].values().val).toBe('11.231')
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')
})
it('should sort IP addresses', function () {
i1.values({ val: '192.168.1.1' })
Expand Down

0 comments on commit 6db40c2

Please sign in to comment.