@@ -106,7 +106,7 @@ const OnBrowserJudge = {
106
106
107
107
nextTest : function ( ) {
108
108
const testCase = this . restTests . shift ( )
109
- const input = document . getElementById ( `${ testCase } _input` ) . innerText
109
+ const input = document . getElementById ( `${ testCase } _input` ) . innerText . trim ( )
110
110
const program = this . process ( this . getProgram ( ) , testCase , input )
111
111
this . timer = setTimeout ( ( ) => this . tle ( testCase ) , this . timeLimit * 2 )
112
112
this . worker . postMessage ( [ "execute" , { testCase, program, input } ] )
@@ -124,7 +124,7 @@ const OnBrowserJudge = {
124
124
result = error == 1 ? "CE" : "RE"
125
125
} else {
126
126
if ( execTime > this . timeLimit ) result = "TLE"
127
- const expected = document . getElementById ( `${ testCase } _output` ) . innerText
127
+ const expected = document . getElementById ( `${ testCase } _output` ) . innerText . trim ( )
128
128
if ( ! this . assertEqual ( expected , output ) ) result = "WA"
129
129
}
130
130
@@ -190,15 +190,11 @@ window.addEventListener("DOMContentLoaded", () => {
190
190
}
191
191
OnBrowserJudge . tests = getTestNames ( )
192
192
193
- function trimAllTestCases ( tests ) {
194
- for ( const test of tests ) {
195
- const input = document . getElementById ( `${ test } _input` )
196
- const output = document . getElementById ( `${ test } _output` )
197
- input . innerText = input . innerText . trim ( )
198
- output . innerText = output . innerText . trim ( )
199
- }
193
+ function trimAllSampleCases ( ) {
194
+ const samples = document . getElementsByClassName ( "sample" )
195
+ for ( const elm of samples ) elm . innerText = elm . innerText . trim ( )
200
196
}
201
- trimAllTestCases ( OnBrowserJudge . tests )
197
+ trimAllSampleCases ( )
202
198
203
199
function addCopyButton ( elms ) {
204
200
for ( const elm of elms ) {
0 commit comments