Skip to content

Commit

Permalink
Update test_sjf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkushSinghGandhi committed Apr 9, 2024
1 parent eacb3ef commit 1dcfffe
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/test_sjf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ def test_sjf_scheduler():
scheduling_output = scheduler.schedule(processes)

# Verify the scheduling output
expected_output = """Process ID\tArrival Time\tBurst Time\tWaiting Time\tTurnaround Time\n\
P1\t\t0\t\t5\t\t3\t\t8\n\
P2\t\t1\t\t3\t\t0\t\t3\n\
P3\t\t2\t\t7\t\t6\t\t13\n\
\n\
Average Waiting Time: 3.0\n\
Average Turnaround Time: 8.0\n\
expected_output = """Process ID\tArrival Time\tBurst Time\tWaiting Time\tTurnaround Time
P1\t\t0\t\t5\t\t3\t\t8
P2\t\t1\t\t3\t\t0\t\t3
P3\t\t2\t\t7\t\t6\t\t13
Average Waiting Time: 3.0
Average Turnaround Time: 8.0
"""
print("Actual Output:")
print(scheduling_output)
print("Expected Output:")
print(expected_output)

assert scheduling_output.strip() == expected_output.strip()

0 comments on commit 1dcfffe

Please sign in to comment.