Skip to content

Commit

Permalink
백준 2467번 용액
Browse files Browse the repository at this point in the history
  • Loading branch information
skysign committed Oct 1, 2024
1 parent 1706a01 commit 21408e9
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 백준 2467번 용액/test1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
5
-99 -2 -1 4 98
1 change: 1 addition & 0 deletions 백준 2467번 용액/test1_answer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-99 98
2 changes: 2 additions & 0 deletions 백준 2467번 용액/test2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
4
-100 -2 -1 103
1 change: 1 addition & 0 deletions 백준 2467번 용액/test2_answer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-2 -1
26 changes: 26 additions & 0 deletions 백준 2467번 용액/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys
from pathlib import Path
from unittest import TestCase
from main import solve


class Test(TestCase):
def my_solve(self, testcase_input):
sys.stdin = open(testcase_input, 'r')
stdout = sys.stdout
sys.stdout = open('stdout.txt', 'w')
solve()
sys.stdout.close()
sys.stdout = stdout

def test_solve(self, testcase_number: str):
self.my_solve('test' + testcase_number + '.txt')
self.assertEqual(
Path('test' + testcase_number + '_answer.txt').read_text().strip(),
Path('stdout.txt').read_text().strip())

def test1_solve(self):
self.test_solve('1')

def test2_solve(self):
self.test_solve('2')

0 comments on commit 21408e9

Please sign in to comment.