テスト
Last updated
Was this helpful?
Was this helpful?
import json
fn test_encode_customer(){
customer := Customer{ first_name: "Vitor", last_name: "Oliveira" }
expected := '{ "first_name": "Vitor", "last_name": "Oliveira" }'
encoded_json := json.encode(customer)
assert encoded_json == expected
}import os
fn test_file_creation() {
file_name := './new_file.txt'
content := 'text'
os.write_file(file_name, content)
assert content.len == os.file_size(file_name)
os.rm(file_name)
}