Test cases / toml

deft toml convert

Change format: --to json|yaml|xml|jsonl

2 runs on real files, 5 tests on generated files, not shown. 0 failed.

Fixed cases

Generated files, compared with ground truth by tools other than deft.

a real Cargo.tomlPassed

deft toml convert ripgrep.toml --to json -o out.json

Input

[package]
name = "ripgrep"
version = "15.2.0"  #:version
authors = ["Andrew Gallant <[email protected]>"]
description = """
ripgrep is a line-oriented search tool that recursively searches the current
directory for a regex pattern while respecting gitignore rules. ripgrep has
first class support on Windows, macOS and Linux.
"""
documentation = "https://github.com/BurntSushi/ripgrep"
repository = "https://github.com/BurntSushi/ripgrep"
keywords = ["regex", "grep", "egrep", "search", "pattern"]
categories = ["command-line-utilities", "text-processing"]
license = "Unlicense OR MIT"
exclude = [
  "HomebrewFormula",
  "/.github/",
  "/ci/",
  "/pkg/brew",
  "/benchsuite/",
  "/scripts/",
  "/crates/fuzz",
]
build = "build.rs"
autotests = false
edition.workspace = true
rust-version.workspace = true

[[bin]]
bench = false
path = "crates/core/main.rs"
name = "rg"

[[test]]
name = "integration"
path = "tests/tests.rs"

[workspace]
members = [
  "crates/globset",
  "crates/grep",
  "crates/cli",
  "crates/matcher",
  "crates/pcre2",
  "crates/printer",
  "crates/regex",
  "crates/searcher",
  "crates/ignore",
]

[workspace.package]
edition = "2024"
rust-version = "1.96"

[dependencies]
anyhow = "1.0.75"
bstr = "1.7.0"
grep = { version = "0.4.1", path = "crates/grep" }
ignore = { version = "0.4.29", path = "crates/ignore" }
lexopt = "0.3.0"
log = "0.4.5"
serde_json = "1.0.23"
termcolor = "1.4.0"
textwrap = { version = "0.16.0", default-features = false }

[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.tikv-jemallocator]
version = "0.7.0"

[dev-dependencies]
serde = "1.0.77"
serde_derive = "1.0.77"
walkdir = "2"

[features]
pcre2 = ["grep/pcre2"]

[profile.release]
debug = 1

[profile.release-lto]
inherits = "release"
opt-level = 3
debug = "none"
strip = "symbols"
debug-assertions = false
overflow-checks = false
lto = "fat"
panic = "abort"
incremental = false
codegen-units = 1

[profile.deb]
inherits = "release-lto"

[package.metadata.deb]
features = ["pcre2"]
section = "utils"
assets = [
  ["target/release/rg", "usr/bin/", "755"],
  ["COPYING", "usr/share/doc/ripgrep/", "644"],
  ["LICENSE-MIT", "usr/share/doc/ripgrep/", "644"],
  ["UNLICENSE", "usr/share/doc/ripgrep/", "644"],
  ["CHANGELOG.md", "usr/share/doc/ripgrep/CHANGELOG", "644"],
  ["README.md", "usr/share/doc/ripgrep/README", "644"],
  ["FAQ.md", "usr/share/doc/ripgrep/FAQ", "644"],
  # The man page is automatically generated by ripgrep's build process, so
  # this file isn't actually committed. Instead, to create a dpkg, either
  # create a deployment/deb directory and copy the man page to it, or use the
  # 'ci/build-deb' script.
  ["deployment/deb/rg.1", "usr/share/man/man1/rg.1", "644"],
  # Similarly for shell completions.
  ["deployment/deb/rg.bash", "usr/share/bash-completion/completions/rg", "644"],
  ["deployment/deb/rg.fish", "usr/share/fish/vendor_completions.d/rg.fish", "644"],
  ["deployment/deb/_rg", "usr/share/zsh/vendor-completions/", "644"],
]
ex
… 223 more characters

Output

out.json 4.3 KB
{
  "package": {
    "name": "ripgrep",
    "version": "15.2.0",
    "authors": [
      "Andrew Gallant <[email protected]>"
    ],
    "description": "ripgrep is a line-oriented search tool that recursively searches the current\ndirectory for a regex pattern while respecting gitignore rules. ripgrep has\nfirst class support on Windows, macOS and Linux.\n",
    "documentation": "https://github.com/BurntSushi/ripgrep",
    "repository": "https://github.com/BurntSushi/ripgrep",
    "keywords": [
      "regex",
      "grep",
      "egrep",
      "search",
      "pattern"
    ],
    "categories": [
      "command-line-utilities",
      "text-processing"
    ],
    "license": "Unlicense OR MIT",
    "exclude": [
      "HomebrewFormula",
      "/.github/",
      "/ci/",
      "/pkg/brew",
      "/benchsuite/",
      "/scripts/",
      "/crates/fuzz"
    ],
    "build": "build.rs",
    "autotests": false,
    "edition": {
      "workspace": true
    },
    "rust-version": {
      "workspace": true
    },
    "metadata": {
      "deb": {
        "features": [
          "pcre2"
        ],
        "section": "utils",
        "assets": [
          [
            "target/release/rg",
            "usr/bin/",
            "755"
          ],
          [
            "COPYING",
            "usr/share/doc/ripgrep/",
            "644"
          ],
          [
            "LICENSE-MIT",
            "usr/share/doc/ripgrep/",
            "644"
          ],
          [
            "UNLICENSE",
            "usr/share/doc/ripgrep/",
            "644"
          ],
          [
            "CHANGELOG.md",
            "usr/share/doc/ripgrep/CHANGELOG",
            "644"
          ],
          [
            "README.md",
            "usr/share/doc/ripgrep/README",
            "644"
          ],
          [
            "FAQ.md",
            "usr/share/doc/ripgrep/FAQ",
            "644"
          ],
          [
            "deployment/deb/rg.1",
            "usr/share/man/man1/rg.1",
            "644"
          ],
          [
            "deployment/deb/rg.bash",
            "usr/share/bash-completion/completions/rg",
            "644"
          ],
          [
            "deployment/deb/rg.fish",
            "usr/share/fish/vendor_completions.d/rg.fish",
            "644"
          ],
          [
            "deployment/deb/_rg",
            "usr/share/zsh/vendor-completions/",
            "644"
          ]
        ],
        "extended-description": "ripgrep (rg) recursively searches your current directory for a regex pattern.\nBy default, ripgrep will respect your .gitignore and automatically skip hidden\nfiles/directories and binary files.\n"
      }
    }
  },
  "bin": [
    {
      "bench": false,
      "path": "crates/core/main.rs",
      "name": "rg"
    }
  ],
  "test": [
    {
      "name": "integration",
      "path": "tests/tests.rs"
    }
  ],
  "workspace": {
    "members": [
      "crates/globset",
      "crates/grep",
      "crates/cli",
      "crates/matcher",
   
… 1370 more characters
What it printed
ok toml.convert ripgrep.toml -> out.json  4KB  0.00s
warning: comments are not kept
Automatic checks (1)
  • python: code = "import json; d = json.load(open('out.json')); assert d['package']['name'] == 'ripgrep', d['package']"

Real-file tasks

Real files and a plain-language job, from the agent benchmark. These are the reference answers, not an agent run.

TOML to YAMLPassed

Convert app.toml to app.yaml.

deft toml convert app.toml -o app.yaml

Input

app.toml 3.1 KB
[package]
name = "ripgrep"
version = "15.2.0"  #:version
authors = ["Andrew Gallant <[email protected]>"]
description = """
ripgrep is a line-oriented search tool that recursively searches the current
directory for a regex pattern while respecting gitignore rules. ripgrep has
first class support on Windows, macOS and Linux.
"""
documentation = "https://github.com/BurntSushi/ripgrep"
repository = "https://github.com/BurntSushi/ripgrep"
keywords = ["regex", "grep", "egrep", "search", "pattern"]
categories = ["command-line-utilities", "text-processing"]
license = "Unlicense OR MIT"
exclude = [
  "HomebrewFormula",
  "/.github/",
  "/ci/",
  "/pkg/brew",
  "/benchsuite/",
  "/scripts/",
  "/crates/fuzz",
]
build = "build.rs"
autotests = false
edition.workspace = true
rust-version.workspace = true

[[bin]]
bench = false
path = "crates/core/main.rs"
name = "rg"

[[test]]
name = "integration"
path = "tests/tests.rs"

[workspace]
members = [
  "crates/globset",
  "crates/grep",
  "crates/cli",
  "crates/matcher",
  "crates/pcre2",
  "crates/printer",
  "crates/regex",
  "crates/searcher",
  "crates/ignore",
]

[workspace.package]
edition = "2024"
rust-version = "1.96"

[dependencies]
anyhow = "1.0.75"
bstr = "1.7.0"
grep = { version = "0.4.1", path = "crates/grep" }
ignore = { version = "0.4.29", path = "crates/ignore" }
lexopt = "0.3.0"
log = "0.4.5"
serde_json = "1.0.23"
termcolor = "1.4.0"
textwrap = { version = "0.16.0", default-features = false }

[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.tikv-jemallocator]
version = "0.7.0"

[dev-dependencies]
serde = "1.0.77"
serde_derive = "1.0.77"
walkdir = "2"

[features]
pcre2 = ["grep/pcre2"]

[profile.release]
debug = 1

[profile.release-lto]
inherits = "release"
opt-level = 3
debug = "none"
strip = "symbols"
debug-assertions = false
overflow-checks = false
lto = "fat"
panic = "abort"
incremental = false
codegen-units = 1

[profile.deb]
inherits = "release-lto"

[package.metadata.deb]
features = ["pcre2"]
section = "utils"
assets = [
  ["target/release/rg", "usr/bin/", "755"],
  ["COPYING", "usr/share/doc/ripgrep/", "644"],
  ["LICENSE-MIT", "usr/share/doc/ripgrep/", "644"],
  ["UNLICENSE", "usr/share/doc/ripgrep/", "644"],
  ["CHANGELOG.md", "usr/share/doc/ripgrep/CHANGELOG", "644"],
  ["README.md", "usr/share/doc/ripgrep/README", "644"],
  ["FAQ.md", "usr/share/doc/ripgrep/FAQ", "644"],
  # The man page is automatically generated by ripgrep's build process, so
  # this file isn't actually committed. Instead, to create a dpkg, either
  # create a deployment/deb directory and copy the man page to it, or use the
  # 'ci/build-deb' script.
  ["deployment/deb/rg.1", "usr/share/man/man1/rg.1", "644"],
  # Similarly for shell completions.
  ["deployment/deb/rg.bash", "usr/share/bash-completion/completions/rg", "644"],
  ["deployment/deb/rg.fish", "usr/share/fish/vendor_completions.d/rg.fish", "644"],
  ["deployment/deb/_rg", "usr/share/zsh/vendor-completions/", "644"],
]
ex
… 223 more characters

Output

app.yaml 3.5 KB
package:
  name: ripgrep
  version: '15.2.0' #:version
  authors:
  - Andrew Gallant <[email protected]>
  description: |
    ripgrep is a line-oriented search tool that recursively searches the current
    directory for a regex pattern while respecting gitignore rules. ripgrep has
    first class support on Windows, macOS and Linux.
  documentation: https://github.com/BurntSushi/ripgrep
  repository: https://github.com/BurntSushi/ripgrep
  keywords:
  - regex
  - grep
  - egrep
  - search
  - pattern
  categories:
  - command-line-utilities
  - text-processing
  license: Unlicense OR MIT
  exclude:
  - HomebrewFormula
  - /.github/
  - /ci/
  - /pkg/brew
  - /benchsuite/
  - /scripts/
  - /crates/fuzz
  build: build.rs
  autotests: false
  edition:
    workspace: true
  rust-version:
    workspace: true
  metadata:
    deb:
      features:
      - pcre2
      section: utils
      assets:
      -
        - target/release/rg
        - usr/bin/
        - '755'
      -
        - COPYING
        - usr/share/doc/ripgrep/
        - '644'
      -
        - LICENSE-MIT
        - usr/share/doc/ripgrep/
        - '644'
      -
        - UNLICENSE
        - usr/share/doc/ripgrep/
        - '644'
      -
        - CHANGELOG.md
        - usr/share/doc/ripgrep/CHANGELOG
        - '644'
      -
        - README.md
        - usr/share/doc/ripgrep/README
        - '644'
      -
        - FAQ.md
        - usr/share/doc/ripgrep/FAQ
        - '644'
      # The man page is automatically generated by ripgrep's build process, so
      # this file isn't actually committed. Instead, to create a dpkg, either
      # create a deployment/deb directory and copy the man page to it, or use the
      # 'ci/build-deb' script.
      -
        - deployment/deb/rg.1
        - usr/share/man/man1/rg.1
        - '644'
      # Similarly for shell completions.
      -
        - deployment/deb/rg.bash
        - usr/share/bash-completion/completions/rg
        - '644'
      -
        - deployment/deb/rg.fish
        - usr/share/fish/vendor_completions.d/rg.fish
        - '644'
      -
        - deployment/deb/_rg
        - usr/share/zsh/vendor-completions/
        - '644'
      extended-description: |
        ripgrep (rg) recursively searches your current directory for a regex pattern.
        By default, ripgrep will respect your .gitignore and automatically skip hidden
        files/directories and binary files.
bin:
- bench: false
  path: crates/core/main.rs
  name: rg
test:
- name: integration
  path: tests/tests.rs
workspace:
  members:
  - crates/globset
  - crates/grep
  - crates/cli
  - crates/matcher
  - crates/pcre2
  - crates/printer
  - crates/regex
  - crates/searcher
  - crates/ignore
  package:
    edition: '2024'
    rust-version: '1.96'
dependencies:
  anyhow: '1.0.75'
  bstr: '1.7.0'
  grep:
    version: '0.4.1'
    path: crates/grep
  ignore:
    version: '0.4.29'
    path: crates/ignore
  lexopt: '0.3.0'
  log: '0.4.5'
  serde_json: '1.0.23'
  termcolor: '1.4.0'
  text
… 588 more characters
Automatic checks (1)
  • python: code = "import yaml; d = yaml.safe_load(open('app.yaml')); assert d['package']['name'] == 'ripgrep' and d['bin'][0]['name'] == 'rg', d"