-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29b2070
commit 5a24e92
Showing
1 changed file
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,57 @@ | ||
import gleeunit | ||
import gleeunit/should | ||
import gloq | ||
|
||
pub fn main() { | ||
gleeunit.main() | ||
} | ||
|
||
// gleeunit test functions end in `_test` | ||
pub fn hello_world_test() { | ||
1 | ||
|> should.equal(1) | ||
pub fn default_groq_request_test() { | ||
let builder = gloq.default_groq_request() | ||
builder.key |> should.equal("") | ||
builder.user |> should.equal("user") | ||
builder.context |> should.equal("") | ||
builder.model |> should.equal("llama3-8b-8192") | ||
} | ||
|
||
pub fn new_groq_request_test() { | ||
let builder = gloq.new_groq_request() | ||
builder.key |> should.equal("") | ||
builder.user |> should.equal("") | ||
builder.context |> should.equal("") | ||
builder.model |> should.equal("") | ||
} | ||
|
||
pub fn with_key_test() { | ||
let builder = gloq.new_groq_request() |> gloq.with_key("test_key") | ||
builder.key |> should.equal("test_key") | ||
} | ||
|
||
pub fn with_user_test() { | ||
let builder = gloq.new_groq_request() |> gloq.with_user("test_user") | ||
builder.user |> should.equal("test_user") | ||
} | ||
|
||
pub fn with_context_test() { | ||
let builder = gloq.new_groq_request() |> gloq.with_context("test_context") | ||
builder.context |> should.equal("test_context") | ||
} | ||
|
||
pub fn with_model_test() { | ||
let builder = gloq.new_groq_request() |> gloq.with_model("test_model") | ||
builder.model |> should.equal("test_model") | ||
} | ||
|
||
pub fn chained_builder_test() { | ||
let builder = | ||
gloq.new_groq_request() | ||
|> gloq.with_key("test_key") | ||
|> gloq.with_user("test_user") | ||
|> gloq.with_context("test_context") | ||
|> gloq.with_model("test_model") | ||
|
||
builder.key |> should.equal("test_key") | ||
builder.user |> should.equal("test_user") | ||
builder.context |> should.equal("test_context") | ||
builder.model |> should.equal("test_model") | ||
} |