"""Simple test for an `add` command."""
import pytest
from cmdl import CommandLine

cmdl = CommandLine()


@cmdl.register(name="add", aliases=["sum"], description="Add arguments as integers.")
def add_command(*args: int) -> None:
    """Add arguments as integers."""
    print(sum(args), end="")


def test_add_command(capfd: pytest.CaptureFixture) -> None:
    """Test `add` command. Should return the sum of arguments."""
    cmdl.execute("add 1 2 3")
    out, err = capfd.readouterr()
    print(type(capfd))
    assert out == "6"

24147a5a5dda0a98b326a30c9752039f1725ed1b
<mask token>


@cmdl.register(name='add', aliases=['sum'], description=
    'Add arguments as integers.')
def add_command(*args: int) ->None:
    """Add arguments as integers."""
    print(sum(args), end='')


<mask token>

<mask token>


@cmdl.register(name='add', aliases=['sum'], description=
    'Add arguments as integers.')
def add_command(*args: int) ->None:
    """Add arguments as integers."""
    print(sum(args), end='')


def test_add_command(capfd: pytest.CaptureFixture) ->None:
    """Test `add` command. Should return the sum of arguments."""
    cmdl.execute('add 1 2 3')
    out, err = capfd.readouterr()
    print(type(capfd))
    assert out == '6'

<mask token>
cmdl = CommandLine()


@cmdl.register(name='add', aliases=['sum'], description=
    'Add arguments as integers.')
def add_command(*args: int) ->None:
    """Add arguments as integers."""
    print(sum(args), end='')


def test_add_command(capfd: pytest.CaptureFixture) ->None:
    """Test `add` command. Should return the sum of arguments."""
    cmdl.execute('add 1 2 3')
    out, err = capfd.readouterr()
    print(type(capfd))
    assert out == '6'

<mask token>
import pytest
from cmdl import CommandLine
cmdl = CommandLine()


@cmdl.register(name='add', aliases=['sum'], description=
    'Add arguments as integers.')
def add_command(*args: int) ->None:
    """Add arguments as integers."""
    print(sum(args), end='')


def test_add_command(capfd: pytest.CaptureFixture) ->None:
    """Test `add` command. Should return the sum of arguments."""
    cmdl.execute('add 1 2 3')
    out, err = capfd.readouterr()
    print(type(capfd))
    assert out == '6'

"""Simple test for an `add` command."""
import pytest
from cmdl import CommandLine

cmdl = CommandLine()


@cmdl.register(name="add", aliases=["sum"], description="Add arguments as integers.")
def add_command(*args: int) -> None:
    """Add arguments as integers."""
    print(sum(args), end="")


def test_add_command(capfd: pytest.CaptureFixture) -> None:
    """Test `add` command. Should return the sum of arguments."""
    cmdl.execute("add 1 2 3")
    out, err = capfd.readouterr()
    print(type(capfd))
    assert out == "6"
