Skip to content
/ iotest Public

The I/O Test is a Python program that can be used to test a CLI program using input/output (I/O) tests generated by GitHub Copilot.

License

Notifications You must be signed in to change notification settings

r2sakib/iotest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

I/O Test

The I/O Test is a Python program that can be used to test a CLI program using input/output (I/O) tests generated by GitHub Copilot. The program reads a text file containing the Copilot generated tests, runs the program being tested with the input values from each test case, and compares the output of the program with the expected output from the test case. If the output matches the expected output, the test is considered to have passed. If the output does not match the expected output, the test is considered to have failed and the expected and actual output are printed to the console.

Requirements

  • Python 3.x
  • A program to be tested
  • A text file containing Copilot generated tests

Usage

To use the I/O Test Runner, follow these steps:

  1. Save the iotest.py file to your computer.

  2. Create a text file containing the Copilot generated tests. The file should be in the following format:

    Test Case 1: Enter number: 5 Enter number 3: 6 Expected Output: stdout
    
    Test Case 2: Enter number 1: 10 Enter number 2: 2 Expected Output: stdout
    

    Each test case should be on a separate line and should contain the input values and the expected output. The input values should be separated by spaces and the expected output should be preceded by the text "Expected Output:" or "Output".

    Generally copy pasting the copilot output will suffice

  • Open a command prompt or terminal window and navigate to the directory containing the iotest.py file and the test file.

  • Run the iotest.py program with the following command:

    python iotest.py <program_path> <tests_path>
    
  1. The program will run the tests and print the results to the console.

Making I/O Test available systemwide

Windows

  1. Create a iotest.bat file and add the command used to run iotest.py
    python path/to/iotest.py
    
  2. Add the path of your iotest.bat file to environment variable.
    1. Open the Start menu and search for "Environment Variables".
    2. Click on "Edit the system environment variables".
    3. Click on the "Environment Variables" button.
    4. Under "System Variables", scroll down and find the "Path" variable.
    5. Click on "Edit".
    6. Click on "New" and add the path of your iotest.bat file.
    7. Click "OK" on all windows to save the changes.
  3. Open a terminal anywhere and run iotest by simply entering:
    iotest <program_path> <tests_path>
    

License

The I/O Test is released under the MIT License. See the LICENSE file for details.

About

The I/O Test is a Python program that can be used to test a CLI program using input/output (I/O) tests generated by GitHub Copilot.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages