Test cases / toml

deft toml merge

Deep-merge files; later files win

1 run on real files, 2 tests on generated files, not shown. 0 failed.

Fixed cases

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

two real filesPassed

deft toml merge ripgrep.toml bat.toml -o out.toml

Input

bat.toml 3.7 KB
[package]
authors = ["David Peter <[email protected]>"]
categories = ["command-line-utilities"]
description = "A cat(1) clone with wings."
homepage = "https://github.com/sharkdp/bat"
license = "MIT OR Apache-2.0"
name = "bat"
repository = "https://github.com/sharkdp/bat"
version = "0.26.1"
exclude = ["assets/syntaxes/*", "assets/themes/*"]
build = "build/main.rs"
edition = '2021'
# You are free to bump MSRV as soon as a reason for bumping emerges.
rust-version = "1.88"

[features]
default = ["application", "git"]
# Feature required for bat the application. Should be disabled when depending on
# bat as a library.
application = [
    "bugreport",
    "build-assets",
    "minimal-application",
]
# Mainly for developers that want to iterate quickly
# Be aware that the included features might change in the future
minimal-application = [
    "clap",
    "etcetera",
    "paging",
    "regex-onig",
    "wild",
]
git = ["gix"] # Support indicating git modifications
paging = [ "shell-words", "grep-cli", "minus"] # Support applying a pager on the output
lessopen = ["execute"] # Support $LESSOPEN preprocessor
build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]

# You need to use one of these if you depend on bat as a library:
regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine

[dependencies]
nu-ansi-term = "0.50.3"
ansi_colours = "^1.2"
bincode = "1.0"
console = "0.16.2"
flate2 = "1.1"
once_cell = "1.20"
thiserror = "2.0"
wild = { version = "2.2", optional = true }
content_inspector = "0.2.4"
shell-words = { version = "1.1.1", optional = true }
minus = { version = "5.7", optional = true, features = [
  "dynamic_output",
  "search",
] }
unicode-width = "0.2.2"
globset = "0.4"
serde = "1.0"
serde_derive = "1.0"
serde_yaml = "0.9.28"
semver = "1.0"
path_abs = { version = "0.5", default-features = false }
clircle = { version = "0.6.1", default-features = false }
bugreport = { version = "0.6.0", optional = true }
etcetera = { version = "0.11.0", optional = true }
grep-cli = { version = "0.1.12", optional = true }
regex = { version = "1.12.3", optional = true }
walkdir = { version = "2.5", optional = true }
bytesize = { version = "2.3.1" }
encoding_rs = "0.8.35"
execute = { version = "0.3.0", optional = true }
terminal-colorsaurus = "1.0"
unicode-segmentation = "1.13.2"
itertools = "0.14.0"

[dependencies.gix]
version = "0.86"
optional = true
default-features = false
features = ["sha1", "blob-diff"]

[dependencies.syntect]
version = "5.3.0"
default-features = false
features = ["parsing"]

[dependencies.clap]
version = "4.6.1"
optional = true
features = ["wrap_help", "cargo"]

[target.'cfg(target_os = "macos")'.dependencies]
plist = "1.9.0"

[dev-dependencies]
assert_cmd = "2.0.16"
expect-test = "1.5.0"
serial_test = { version = "2.0.0", default-features = false }
predicates = "3.1.4"
wait-timeout = "0.2.1"
tempfile = "3.27.0"
serde = { ve
… 773 more characters
[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.toml 6.3 KB
[package]
name = "bat"
version = "0.26.1" #:version
authors = ["David Peter <[email protected]>"]
description = "A cat(1) clone with wings."
documentation = "https://github.com/BurntSushi/ripgrep"
repository = "https://github.com/sharkdp/bat"
keywords = ["regex", "grep", "egrep", "search", "pattern"]
categories = ["command-line-utilities"]
license = "MIT OR Apache-2.0"
exclude = ["assets/syntaxes/*", "assets/themes/*"]
build = "build/main.rs"
autotests = false
edition = "2021"
# You are free to bump MSRV as soon as a reason for bumping emerges.
rust-version = "1.88"
homepage = "https://github.com/sharkdp/bat"

[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"],
]
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",
]

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

[dependencies]
anyhow = "1.0.75"
bstr = "1.7.0"
lexopt = "0.3.0"
log = "0.4.5"
serde_json = "1.0.23"
termcolor = "1.4.0"
nu-ansi-term = "0.50.3"
ansi_colours = "^1.2"
bincode = "1.0"
console = "0.16.2"
flate2 = "1.1"
once_cell = "1.20"
thiserror = "2.0"
content_inspector = "0.2.4"
unicode-width = "0.2.2"
globset = "0.4"
serde = "1.0"
serde_derive = "1.0"
serde_yaml = "0.9.28"
semver = "1.0"
encoding_rs = "0.8.35"
terminal-colorsaurus = "1.0"
unicode-segmentation = "1.13.2"
itertools = "0.14.0"

[dependencies.grep]
version = "0.4.1"
path = "crates/grep"

[dependencies.ignore]
version = "0.4.29"
path = "crates/ignore"

[dependencies.textwrap]
version = "0.16.0"
default-features = false

[dependencie
… 3471 more characters
What it printed
ok toml.merge ripgrep.toml bat.toml -> out.toml  6KB  0.00s
Automatic checks (1)
  • python: code = "import toml; assert toml.load('out.toml')['package']['name'] == 'bat'"