dymokomi/luce-git
Source of release 0.5.2
0.5.2 / tests / git / main.lucb
import git
pub func main(arguments: str[]) -> i32!:
_ = arguments
var id: u8[20]
var text: u8[40]
try git.hash_blob(b"hello\n", id)
try git.hex_id(id, text)
## git hash-object of "hello\n"
let expect = b"ce013625030ba8dba906f756967f9e9ca394464a"
for i in 0..<(usize)40: assert(text[i] == expect[i])
try git.hash_blob(b"", id)
try git.hex_id(id, text)
let empty = b"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
for i in 0..<(usize)40: assert(text[i] == empty[i])
print("PASS Git blob SHA-1 object IDs")
return 0