test_toml.aug | |
Augeas Tests | |
Toml. | String value |
Toml. | Integer value |
Toml. | Positive integer value |
Toml. | Negative integer value |
Toml. | Large integer value |
Toml. | Hexadecimal integer value |
Toml. | Octal integer value |
Toml. | Binary integer value |
Toml. | Float value |
Toml. | Positive float value |
Toml. | Negative float value |
Toml. | Complex float value |
Toml. | Inf float value |
Toml. | Nan float value |
Toml. | Bool value |
Toml. | Datetime value |
Toml. | Date value |
Toml. | Time value |
Toml. | String value with newline |
Toml. | Multiline value |
Toml. | Literal string value |
Toml. | Empty array |
Toml. | Array of strings |
Toml. | Array of arrays |
Toml.lns | Global parameters |
Toml.lns | Simple section/value |
Toml.lns | Subsections |
Toml.lns | Nested subsections |
Toml.lns | Arrays of tables |
Toml. | Empty inline table |
Toml. | Inline table |
Augeas Variables | |
example | The example from https://github.com/mojombo/toml |
test Toml.lns get "[[products]] name = \"Hammer\" sku = 738594937 [[products]] [[products]] name = \"Nail\" sku = 284758393 color = \"gray\"\n" = { "@table" = "products" { "entry" = "name" { "string" = "Hammer" } } { "entry" = "sku" { "integer" = "738594937" } } { } } { "@table" = "products" { } } { "@table" = "products" { "entry" = "name" { "string" = "Nail" } } { "entry" = "sku" { "integer" = "284758393" } } { "entry" = "color" { "string" = "gray" } } }
Arrays of tables
let example = "# This is a TOML document. Boom. title = \"TOML Example\" [owner] name = \"Tom Preston-Werner\" organization = \"GitHub\" bio = \"GitHub Cofounder & CEO\nLikes tater tots and beer.\" dob = 1979-05-27T07:32:00Z # First class dates? Why not? [database] server = \"192.168.1.1\" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true [servers] # You can indent as you please. Tabs or spaces. TOML don't care. [servers.alpha] ip = \"10.0.0.1\" dc = \"eqdc10\" [servers.beta] ip = \"10.0.0.2\" dc = \"eqdc10\" country = \"ä¸å½\" # This should be parsed as UTF-8 [clients] data = [ [\"gamma\", \"delta\"], [1, 2] ] # just an update to make sure parsers support it # Line breaks are OK when inside arrays hosts = [ \"alpha\", \"omega\" ] # Products [[products]] name = \"Hammer\" sku = 738594937 [[products]] name = \"Nail\" sku = 284758393 color = \"gray\" " test Toml.lns get example = { "#comment" = "This is a TOML document. Boom." } { } { "entry" = "title" { "string" = "TOML Example" } } { } { "table" = "owner" { "entry" = "name" { "string" = "Tom Preston-Werner" } } { "entry" = "organization" { "string" = "GitHub" } } { "entry" = "bio" { "string" = "GitHub Cofounder & CEO Likes tater tots and beer." } } { "entry" = "dob" { "datetime" = "1979-05-27T07:32:00Z" } { "#comment" = "First class dates? Why not?" } } { } } { "table" = "database" { "entry" = "server" { "string" = "192.168.1.1" } } { "entry" = "ports" { "array" { } { "integer" = "8001" } { } { "integer" = "8001" } { } { "integer" = "8002" } { } } } { "entry" = "connection_max" { "integer" = "5000" } } { "entry" = "enabled" { "bool" = "true" } } { } } { "table" = "servers" { } { "#comment" = "You can indent as you please. Tabs or spaces. TOML don't care." } } { "table" = "servers.alpha" { "entry" = "ip" { "string" = "10.0.0.1" } } { "entry" = "dc" { "string" = "eqdc10" } } { } } { "table" = "servers.beta" { "entry" = "ip" { "string" = "10.0.0.2" } } { "entry" = "dc" { "string" = "eqdc10" } } { "entry" = "country" { "string" = "ä¸å½" } { "#comment" = "This should be parsed as UTF-8" } } { } } { "table" = "clients" { "entry" = "data" { "array" { } { "array" { "string" = "gamma" } { } { "string" = "delta" } } { } { "array" { "integer" = "1" } { } { "integer" = "2" } } { } } { "#comment" = "just an update to make sure parsers support it" } } { } { "#comment" = "Line breaks are OK when inside arrays" } { "entry" = "hosts" { "array" { } { "string" = "alpha" } { } { "string" = "omega" } { } } } { } { "#comment" = "Products" } { } } { "@table" = "products" { "entry" = "name" { "string" = "Hammer" } } { "entry" = "sku" { "integer" = "738594937" } } { } } { "@table" = "products" { "entry" = "name" { "string" = "Nail" } } { "entry" = "sku" { "integer" = "284758393" } } { "entry" = "color" { "string" = "gray" } } }
The example from https://github.com/mojombo/toml
String value
test Toml.norec get "\"foo\"" = { "string" = "foo" }
Empty array
test Toml.array_norec get "[ ]" = { "array" {} }
Global parameters
test Toml.lns get "# Globals foo = \"bar\"\n" = { "#comment" = "Globals" } { "entry" = "foo" { "string" = "bar" } }
Empty inline table
test Toml.entry get "name = { }\n" = { "entry" = "name" { "inline_table" { } } }
The example from https://github.com/mojombo/toml
let example = "# This is a TOML document. Boom. title = \"TOML Example\" [owner] name = \"Tom Preston-Werner\" organization = \"GitHub\" bio = \"GitHub Cofounder & CEO\nLikes tater tots and beer.\" dob = 1979-05-27T07:32:00Z # First class dates? Why not? [database] server = \"192.168.1.1\" ports = [ 8001, 8001, 8002 ] connection_max = 5000 enabled = true [servers] # You can indent as you please. Tabs or spaces. TOML don't care. [servers.alpha] ip = \"10.0.0.1\" dc = \"eqdc10\" [servers.beta] ip = \"10.0.0.2\" dc = \"eqdc10\" country = \"ä¸å½\" # This should be parsed as UTF-8 [clients] data = [ [\"gamma\", \"delta\"], [1, 2] ] # just an update to make sure parsers support it # Line breaks are OK when inside arrays hosts = [ \"alpha\", \"omega\" ] # Products [[products]] name = \"Hammer\" sku = 738594937 [[products]] name = \"Nail\" sku = 284758393 color = \"gray\" " test Toml.lns get example = { "#comment" = "This is a TOML document. Boom." } { } { "entry" = "title" { "string" = "TOML Example" } } { } { "table" = "owner" { "entry" = "name" { "string" = "Tom Preston-Werner" } } { "entry" = "organization" { "string" = "GitHub" } } { "entry" = "bio" { "string" = "GitHub Cofounder & CEO Likes tater tots and beer." } } { "entry" = "dob" { "datetime" = "1979-05-27T07:32:00Z" } { "#comment" = "First class dates? Why not?" } } { } } { "table" = "database" { "entry" = "server" { "string" = "192.168.1.1" } } { "entry" = "ports" { "array" { } { "integer" = "8001" } { } { "integer" = "8001" } { } { "integer" = "8002" } { } } } { "entry" = "connection_max" { "integer" = "5000" } } { "entry" = "enabled" { "bool" = "true" } } { } } { "table" = "servers" { } { "#comment" = "You can indent as you please. Tabs or spaces. TOML don't care." } } { "table" = "servers.alpha" { "entry" = "ip" { "string" = "10.0.0.1" } } { "entry" = "dc" { "string" = "eqdc10" } } { } } { "table" = "servers.beta" { "entry" = "ip" { "string" = "10.0.0.2" } } { "entry" = "dc" { "string" = "eqdc10" } } { "entry" = "country" { "string" = "ä¸å½" } { "#comment" = "This should be parsed as UTF-8" } } { } } { "table" = "clients" { "entry" = "data" { "array" { } { "array" { "string" = "gamma" } { } { "string" = "delta" } } { } { "array" { "integer" = "1" } { } { "integer" = "2" } } { } } { "#comment" = "just an update to make sure parsers support it" } } { } { "#comment" = "Line breaks are OK when inside arrays" } { "entry" = "hosts" { "array" { } { "string" = "alpha" } { } { "string" = "omega" } { } } } { } { "#comment" = "Products" } { } } { "@table" = "products" { "entry" = "name" { "string" = "Hammer" } } { "entry" = "sku" { "integer" = "738594937" } } { } } { "@table" = "products" { "entry" = "name" { "string" = "Nail" } } { "entry" = "sku" { "integer" = "284758393" } } { "entry" = "color" { "string" = "gray" } } }