mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-15 11:04:49 +00:00
11 lines
316 B
TypeScript
11 lines
316 B
TypeScript
import { Status, statusToFlag } from './protocol';
|
|
|
|
describe('status flags should fit in 32 bits', () => {
|
|
test.each(Object.values(Status).filter((x) => typeof x === 'number'))(
|
|
'%s',
|
|
(status) => {
|
|
expect(Math.log2(statusToFlag(status as Status))).toBe(status);
|
|
},
|
|
);
|
|
});
|