Change instances of Value::string("foo", Span::test_data()) to Value::test_string("foo") (#7592)

This commit is contained in:
Leon
2022-12-24 19:25:38 +10:00
committed by GitHub
parent 3d682fe957
commit 11bdab7e61
50 changed files with 191 additions and 235 deletions

View File

@@ -140,27 +140,27 @@ prints out the list properly."#
Example {
description: "Render a simple list to a grid",
example: "[1 2 3 a b c] | grid",
result: Some(Value::string("1 │ 2 │ 3 │ a │ b │ c\n", Span::test_data())),
result: Some(Value::test_string("1 │ 2 │ 3 │ a │ b │ c\n")),
},
Example {
description: "The above example is the same as:",
example: "[1 2 3 a b c] | wrap name | grid",
result: Some(Value::string("1 │ 2 │ 3 │ a │ b │ c\n", Span::test_data())),
result: Some(Value::test_string("1 │ 2 │ 3 │ a │ b │ c\n")),
},
Example {
description: "Render a record to a grid",
example: "{name: 'foo', b: 1, c: 2} | grid",
result: Some(Value::string("foo\n", Span::test_data())),
result: Some(Value::test_string("foo\n")),
},
Example {
description: "Render a list of records to a grid",
example: "[{name: 'A', v: 1} {name: 'B', v: 2} {name: 'C', v: 3}] | grid",
result: Some(Value::string("A │ B │ C\n", Span::test_data())),
result: Some(Value::test_string("A │ B │ C\n")),
},
Example {
description: "Render a table with 'name' column in it to a grid",
example: "[[name patch]; [0.1.0 false] [0.1.1 true] [0.2.0 false]] | grid",
result: Some(Value::string("0.1.0 │ 0.1.1 │ 0.2.0\n", Span::test_data())),
result: Some(Value::test_string("0.1.0 │ 0.1.1 │ 0.2.0\n")),
},
]
}

View File

@@ -356,17 +356,17 @@ fn handle_table_command(
fn supported_table_modes() -> Vec<Value> {
vec![
Value::string("basic", Span::test_data()),
Value::string("compact", Span::test_data()),
Value::string("compact_double", Span::test_data()),
Value::string("default", Span::test_data()),
Value::string("heavy", Span::test_data()),
Value::string("light", Span::test_data()),
Value::string("none", Span::test_data()),
Value::string("reinforced", Span::test_data()),
Value::string("rounded", Span::test_data()),
Value::string("thin", Span::test_data()),
Value::string("with_love", Span::test_data()),
Value::test_string("basic"),
Value::test_string("compact"),
Value::test_string("compact_double"),
Value::test_string("default"),
Value::test_string("heavy"),
Value::test_string("light"),
Value::test_string("none"),
Value::test_string("reinforced"),
Value::test_string("rounded"),
Value::test_string("thin"),
Value::test_string("with_love"),
]
}