(* Module: Test_BeeGFS_config Provides unit tests and examples for the lens. *) module Test_BeeGFS_config = (* Variable: conf *) let conf = "# this is a comment mykey = myvalue # eol comment anotherkey = another value " (* Test: BeeGFS_config.lns *) test BeeGFS_config.lns get conf = { "#comment" = "this is a comment" } { } { "mykey" = "myvalue" { "#comment" = "eol comment" } } { "anotherkey" = "another value" } (* Test: BeeGFS_config.lns Quotes are OK in variables that do not begin with a quote *) test BeeGFS_config.lns get "UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'\n" = { "UserParameter" = "custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'" } (* Test: BeeGFS_config.lns Support flags *) test BeeGFS_config.lns get "dnsadminapp\n" = { "dnsadminapp" } (* Test: BeeGFS_config.lns Support empty values *) test BeeGFS_config.lns get "foo =\n" = { "foo" = "" { } } (* Test: BeeGFS_config.lns Support IP value *) test BeeGFS_config.lns get "sysMgmtdHost = 192.168.1.1\n" = { "sysMgmtdHost" = "192.168.1.1" }