Adafruit_CircuitPython_PIOASM/tests/test_radix.py
KB Sriram 3e6a8bc392 Add type annotations for library and tests.
Verified that `mypy --strict adafruit_pioasm.py tests` runs without
errors.

Fixes: https://github.com/adafruit/Adafruit_CircuitPython_PIOASM/issues/24
2024-05-27 12:30:52 -07:00

21 lines
505 B
Python

# SPDX-FileCopyrightText: 2021 Jeff Epler, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
Tests radix
"""
from pytest_helpers import assert_assembles_to
def test_octal() -> None:
assert_assembles_to(".side_set 0o1\nset x, 0o11", [0b111_00000_001_01001])
def test_binary() -> None:
assert_assembles_to(".side_set 0b101\nnop side 0b10001", [0b101_10001_010_00_010])
def test_hex() -> None:
assert_assembles_to(".side_set 0x0\nnop [0x10]", [0b101_10000_010_00_010])