def test_lib_search(clirunner, validate_cliresult):
    result = clirunner.invoke(cli, ["search", "DHT22"])
    validate_cliresult(result)
    match = re.search(r"Found\s+(\d+)\slibraries:", result.output)
    assert int(match.group(1)) > 2

    result = clirunner.invoke(cli, ["search", "DHT22", "--platform=timsp430"])
    validate_cliresult(result)
    match = re.search(r"Found\s+(\d+)\slibraries:", result.output)
    assert int(match.group(1)) == 1
dataset/ETHPy150Open platformio/platformio/tests/commands/test_lib.py/test_lib_search/original