File: test_float.R

package info (click to toggle)
r-cran-rcpptoml 0.2.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 280 kB
  • sloc: cpp: 204; sh: 14; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 566 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

library(RcppTOML)

toml <- parseToml("float.toml")

expect_equal(names(toml), c("float"))
expect_equal(names(toml$float), c("both", "exponent", "fractional", "underscores"))

expect_equal(toml$float$both$key, 6.626e-34)

expect_equal(toml$float$exponent$key1, 5e22)
expect_equal(toml$float$exponent$key2, 1e+06)
expect_equal(toml$float$exponent$key3, -0.02)

expect_equal(toml$float$fractional$key1, 1)
expect_equal(toml$float$fractional$key2, 3.1415)
expect_equal(toml$float$fractional$key3, -0.01)

expect_equal(toml$float$underscores$key1, 9224617.445991228313)