@@ -33,6 +33,67 @@ export default async function TestCasePage() {
3333 JSON . parse ( data ) ,
3434 ) as Promise < Record < string , { title : string ; description : string } > > ,
3535 ] )
36+ let totalTest = 0
37+ let totalFail = 0
38+ const cases = Object . entries ( ruleMap ) . map ( ( [ key , value ] ) => {
39+ totalTest += testStatus [ key ] [ 0 ]
40+ totalFail += testStatus [ key ] [ 1 ]
41+ return (
42+ < VStack
43+ key = { key }
44+ flex = "1"
45+ gap = { [ '30px' , null , null , '40px' ] }
46+ px = { [ '16px' , null , null , '60px' ] }
47+ py = { [ '30px' , null , null , '40px' ] }
48+ >
49+ < VStack gap = "20px" >
50+ < Text color = "$title" typography = "docsTitle" >
51+ { value . title } ({ testStatus [ key ] [ 0 ] - testStatus [ key ] [ 1 ] } /
52+ { testStatus [ key ] [ 0 ] } )
53+ </ Text >
54+ < Text color = "$text" typography = "body" >
55+ { value . description }
56+ </ Text >
57+ </ VStack >
58+ < Box bg = "$text" h = "1px" />
59+ < Grid
60+ gap = "8px"
61+ gridTemplateColumns = "repeat(auto-fill, minmax(16px, 1fr))"
62+ >
63+ { testStatus [ key ] [ 2 ] . map (
64+ ( [ text , expected , actual , isSuccess ] , idx ) => {
65+ const textParts = parseTextWithLaTeX ( text )
66+
67+ return (
68+ < TestCaseCircle key = { text + idx } isSuccess = { isSuccess } >
69+ < Text
70+ color = "#FFF"
71+ typography = "body"
72+ whiteSpace = "nowrap"
73+ wordBreak = "keep-all"
74+ >
75+ { textParts . map ( ( part , partIdx ) =>
76+ part . type === 'latex' ? (
77+ < Latex key = { partIdx } > ${ part . content } $</ Latex >
78+ ) : (
79+ < span key = { partIdx } > { part . content } </ span >
80+ ) ,
81+ ) }
82+ < br />
83+ 정답 : { expected }
84+ < br />
85+ 결과 : { actual }
86+ < br />
87+ { isSuccess ? '✅ 테스트 성공' : '❌ 테스트 실패' }
88+ </ Text >
89+ </ TestCaseCircle >
90+ )
91+ } ,
92+ ) }
93+ </ Grid >
94+ </ VStack >
95+ )
96+ } )
3697
3798 return (
3899 < Box maxW = "1920px" mx = "auto" pb = "100px" w = "100%" >
@@ -42,7 +103,8 @@ export default async function TestCasePage() {
42103 py = { [ '30px' , null , null , '40px' ] }
43104 >
44105 < Text color = "$title" typography = "title" >
45- 테스트 케이스
106+ 테스트 케이스 ({ ( totalTest - totalFail ) . toLocaleString ( ) } /
107+ { totalTest . toLocaleString ( ) } )
46108 </ Text >
47109 < Text color = "$text" typography = "body" >
48110 모든 테스트 케이스는{ ' ' }
@@ -60,63 +122,7 @@ export default async function TestCasePage() {
60122 을 기반으로 작성되었습니다.
61123 </ Text >
62124 </ VStack >
63- { Object . entries ( ruleMap ) . map ( ( [ key , value ] ) => {
64- return (
65- < VStack
66- key = { key }
67- flex = "1"
68- gap = { [ '30px' , null , null , '40px' ] }
69- px = { [ '16px' , null , null , '60px' ] }
70- py = { [ '30px' , null , null , '40px' ] }
71- >
72- < VStack gap = "20px" >
73- < Text color = "$title" typography = "docsTitle" >
74- { value . title } ({ testStatus [ key ] [ 0 ] } /
75- { testStatus [ key ] [ 1 ] + testStatus [ key ] [ 0 ] } )
76- </ Text >
77- < Text color = "$text" typography = "body" >
78- { value . description }
79- </ Text >
80- </ VStack >
81- < Box bg = "$text" h = "1px" />
82- < Grid
83- gap = "8px"
84- gridTemplateColumns = "repeat(auto-fill, minmax(16px, 1fr))"
85- >
86- { testStatus [ key ] [ 2 ] . map (
87- ( [ text , expected , actual , isSuccess ] , idx ) => {
88- const textParts = parseTextWithLaTeX ( text )
89-
90- return (
91- < TestCaseCircle key = { text + idx } isSuccess = { isSuccess } >
92- < Text
93- color = "#FFF"
94- typography = "body"
95- whiteSpace = "nowrap"
96- wordBreak = "keep-all"
97- >
98- { textParts . map ( ( part , partIdx ) =>
99- part . type === 'latex' ? (
100- < Latex key = { partIdx } > ${ part . content } $</ Latex >
101- ) : (
102- < span key = { partIdx } > { part . content } </ span >
103- ) ,
104- ) }
105- < br />
106- 정답 : { expected }
107- < br />
108- 결과 : { actual }
109- < br />
110- { isSuccess ? '✅ 테스트 성공' : '❌ 테스트 실패' }
111- </ Text >
112- </ TestCaseCircle >
113- )
114- } ,
115- ) }
116- </ Grid >
117- </ VStack >
118- )
119- } ) }
125+ { cases }
120126 </ Box >
121127 )
122128}
0 commit comments