tests/testthat/test-types.R

test_that("GGML_TYPE_F32 constant is defined", {
  expect_equal(GGML_TYPE_F32, 0L)
})

test_that("type size calculation works", {
  # F32 должен быть 4 байта
  ctx <- ggml_init(1024 * 1024)
  tensor <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 100)
  
  expect_equal(ggml_nbytes(tensor), 400)  # 100 * 4
  
  ggml_free(ctx)
})

Try the ggmlR package in your browser

Any scripts or data that you put into this service are public.

ggmlR documentation built on July 14, 2026, 1:08 a.m.