Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
javalikescript committed May 15, 2021
1 parent a9881d3 commit d43c612
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jls/util/md/Crc32-.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ return require('jls.lang.class').create(function(crc32)

end, function(Crc32)

function Crc32:digest(m)
function Crc32.digest(m)
return compute(m) ~ MAX
end

Expand Down
4 changes: 2 additions & 2 deletions jls/util/md/sha1-.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ return require('jls.lang.class').create(function(sha1)
end

function sha1:final()
return sha1Lib.binary(self.buffer:toString())
return (sha1Lib.binary(self.buffer:toString()))
end

end, function(Sha1)

function Sha1:digest(s)
--return Sha1:new():update(s):final()
return sha1Lib.binary(s)
return (sha1Lib.binary(s))
end
end)
18 changes: 17 additions & 1 deletion runtests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
SETLOCAL

SET ALL=no
SET BASE=no
SET VERBOSE=no
SET JLS_REQUIRES=

Expand All @@ -12,14 +13,16 @@ SHIFT
IF %ARG%==-v SET VERBOSE=yes
IF %ARG%==-a SET ALL=yes
IF %ARG%==all SET ALL=yes
IF %ARG%==-b SET BASE=yes
IF %ARG%==base SET BASE=yes
IF %ARG%==luv SET JLS_REQUIRES=!socket,!lfs
IF %ARG%==socket SET JLS_REQUIRES=!luv
IF %ARG%==nossl SET JLS_REQUIRES=!openssl
GOTO :args

:main
SET JLS_LOGGER_LEVEL=
SET LUA=lua53
SET LUA=lua54
WHERE /Q %LUA%
IF ERRORLEVEL 1 SET LUA=lua
IF %VERBOSE%==yes (
Expand All @@ -29,10 +32,23 @@ IF %VERBOSE%==yes (
)

IF %ALL%==yes GOTO :runall
IF %BASE%==yes GOTO :runbase

CALL :runtests
GOTO :eof

:runbase
IF %VERBOSE%==yes ECHO JLS_REQUIRES=%JLS_REQUIRES%
SET TESTCOUNT=0
SET ERRORCOUNT=0
CALL :rundir base
IF %ERRORCOUNT% NEQ 0 (
ECHO %ERRORCOUNT%/%TESTCOUNT% files in error
) ELSE (
ECHO %TESTCOUNT% files passed
)
GOTO :eof

:runall
SET JLS_REQUIRES=!socket,!lfs
CALL :runtests
Expand Down

0 comments on commit d43c612

Please sign in to comment.