Files
xahau.js/packages/ripple-binary-codec/test/uint.test.js
Nathan Nichols ba04ea5f1f Refactored UInt and Derived Classes (#83)
Refactored UInt and Derived classes to be constructed from Buffers, and swapped out BN.js in favor of BigInt to reduce dependencies.
2020-07-10 15:24:49 -05:00

41 lines
893 B
JavaScript

const { coreTypes } = require('../dist/types')
const { UInt8, UInt64 } = coreTypes
test('compareToTests', () => {
expect(UInt8.from(124).compareTo(UInt64.from(124))).toBe(0)
})
test('compareToTest', () => {
expect(UInt64.from(124).compareTo(UInt8.from(124))).toBe(0)
})
test('compareToTest', () => {
expect(UInt64.from(124).compareTo(UInt8.from(123))).toBe(1)
})
test('compareToTest', () => {
expect(UInt8.from(124).compareTo(UInt8.from(13))).toBe(1)
})
test('compareToTest', () => {
expect(UInt8.from(124).compareTo(124)).toBe(0)
})
test('compareToTest', () => {
expect(UInt64.from(124).compareTo(124)).toBe(0)
})
test('compareToTest', () => {
expect(UInt64.from(124).compareTo(123)).toBe(1)
})
test('compareToTest', () => {
expect(UInt8.from(124).compareTo(13)).toBe(1)
})
test('valueOfTests', () => {
let val = UInt8.from(1)
val |= 0x2
expect(val).toBe(3)
})