Init
This commit is contained in:
40
tests.odin
Normal file
40
tests.odin
Normal file
@@ -0,0 +1,40 @@
|
||||
package main
|
||||
|
||||
import sz "szlib"
|
||||
|
||||
create_test_dataset :: proc() -> sz.Dataset {
|
||||
|
||||
test_dataset: sz.Dataset = {
|
||||
name = "Test Dataset",
|
||||
id = "test_dataset",
|
||||
uuid = create_uuid(),
|
||||
data_object_type = "items",
|
||||
objects = make([dynamic]sz.SzDataObject)
|
||||
}
|
||||
|
||||
test_dataset_object: sz.SzDataObject = {
|
||||
id = "test-item",
|
||||
name = "Test Item",
|
||||
fields = make([dynamic]sz.SzField)
|
||||
}
|
||||
|
||||
test_field: sz.SzField = {
|
||||
id = "cost",
|
||||
type = .NUMBER,
|
||||
is_list = false,
|
||||
value = "100"
|
||||
}
|
||||
|
||||
test_field2: sz.SzField = {
|
||||
id = "some_string",
|
||||
type = .TEXT,
|
||||
is_list = false,
|
||||
value = "This is some text"
|
||||
}
|
||||
|
||||
append(&test_dataset_object.fields, test_field)
|
||||
append(&test_dataset_object.fields, test_field2)
|
||||
append(&test_dataset.objects, test_dataset_object)
|
||||
|
||||
return test_dataset
|
||||
}
|
||||
Reference in New Issue
Block a user