mirror of
https://github.com/nushell/nushell.git
synced 2025-08-18 16:58:51 +02:00
refactor: change column names from 'Column*' to 'column*' (#4556)
This commit is contained in:
@@ -23,7 +23,7 @@ fn headers_adds_missing_column_name() {
|
||||
open sample_headers.xlsx
|
||||
| get Sheet1
|
||||
| headers
|
||||
| get Column1
|
||||
| get column1
|
||||
| to json --raw"#
|
||||
));
|
||||
|
||||
|
@@ -11,7 +11,7 @@ fn lines() {
|
||||
| skip 1
|
||||
| first 1
|
||||
| split column "="
|
||||
| get Column1.0
|
||||
| get column1.0
|
||||
| str trim
|
||||
"#
|
||||
));
|
||||
|
@@ -122,7 +122,7 @@ fn parses_into_correct_number_of_columns() {
|
||||
echo 'home/viking/spam.txt'
|
||||
| path parse
|
||||
| transpose
|
||||
| get Column0
|
||||
| get column0
|
||||
| length
|
||||
"#
|
||||
));
|
||||
|
@@ -8,10 +8,10 @@ mod rows {
|
||||
r#"
|
||||
echo [
|
||||
[service, status];
|
||||
|
||||
[ruby, DOWN]
|
||||
[db, DOWN]
|
||||
[nud, DOWN]
|
||||
|
||||
[ruby, DOWN]
|
||||
[db, DOWN]
|
||||
[nud, DOWN]
|
||||
[expected, HERE]
|
||||
]"#,
|
||||
)
|
||||
@@ -52,10 +52,10 @@ mod columns {
|
||||
r#"
|
||||
echo [
|
||||
[commit_author, origin, stars];
|
||||
|
||||
[ "Andres", EC, amarillito]
|
||||
[ "Darren", US, black]
|
||||
[ "Jonathan", US, black]
|
||||
|
||||
[ "Andres", EC, amarillito]
|
||||
[ "Darren", US, black]
|
||||
[ "Jonathan", US, black]
|
||||
[ "Yehuda", US, black]
|
||||
[ "Jason", CA, gold]
|
||||
]"#,
|
||||
@@ -122,7 +122,7 @@ mod columns {
|
||||
//
|
||||
// output:
|
||||
// [
|
||||
// [Column1, Column2, Column3, Column4, Column5, Column6, Column7, Column8];
|
||||
// [column1, column2, column3, column4, column5, column6, column7, column8];
|
||||
// [ 0, 0, 0, 0, 0, 1, 0, 0]
|
||||
// ]
|
||||
//
|
||||
|
@@ -6,7 +6,7 @@ fn counter_clockwise() {
|
||||
r#"
|
||||
echo [
|
||||
[col1, col2, EXPECTED];
|
||||
|
||||
|
||||
[---, "|||", XX1]
|
||||
[---, "|||", XX2]
|
||||
[---, "|||", XX3]
|
||||
@@ -17,14 +17,14 @@ fn counter_clockwise() {
|
||||
let expected = nu!(cwd: ".", pipeline(
|
||||
r#"
|
||||
echo [
|
||||
[ Column0, Column1, Column2, Column3];
|
||||
[ column0, column1, column2, column3];
|
||||
|
||||
[ EXPECTED, XX1, XX2, XX3]
|
||||
[ col2, "|||", "|||", "|||"]
|
||||
[ col1, ---, ---, ---]
|
||||
]
|
||||
| where Column0 == EXPECTED
|
||||
| get Column1 Column2 Column3
|
||||
| where column0 == EXPECTED
|
||||
| get column1 column2 column3
|
||||
| str collect "-"
|
||||
"#,
|
||||
));
|
||||
@@ -33,8 +33,8 @@ fn counter_clockwise() {
|
||||
cwd: ".",
|
||||
format!("{} | {}", table, pipeline(r#"
|
||||
rotate --ccw
|
||||
| where Column0 == EXPECTED
|
||||
| get Column1 Column2 Column3
|
||||
| where column0 == EXPECTED
|
||||
| get column1 column2 column3
|
||||
| str collect "-"
|
||||
"#)));
|
||||
|
||||
@@ -47,7 +47,7 @@ fn clockwise() {
|
||||
r#"
|
||||
echo [
|
||||
[col1, col2, EXPECTED];
|
||||
|
||||
|
||||
[ ---, "|||", XX1]
|
||||
[ ---, "|||", XX2]
|
||||
[ ---, "|||", XX3]
|
||||
@@ -58,14 +58,14 @@ fn clockwise() {
|
||||
let expected = nu!(cwd: ".", pipeline(
|
||||
r#"
|
||||
echo [
|
||||
[ Column0, Column1, Column2, Column3];
|
||||
[ column0, column1, column2, column3];
|
||||
|
||||
[ ---, ---, ---, col1]
|
||||
[ "|||", "|||", "|||", col2]
|
||||
[ XX3, XX2, XX1, EXPECTED]
|
||||
]
|
||||
| where Column3 == EXPECTED
|
||||
| get Column0 Column1 Column2
|
||||
| where column3 == EXPECTED
|
||||
| get column0 column1 column2
|
||||
| str collect "-"
|
||||
"#,
|
||||
));
|
||||
@@ -74,8 +74,8 @@ fn clockwise() {
|
||||
cwd: ".",
|
||||
format!("{} | {}", table, pipeline(r#"
|
||||
rotate
|
||||
| where Column3 == EXPECTED
|
||||
| get Column0 Column1 Column2
|
||||
| where column3 == EXPECTED
|
||||
| get column0 column1 column2
|
||||
| str collect "-"
|
||||
"#)));
|
||||
|
||||
|
@@ -10,10 +10,10 @@ fn by_column() {
|
||||
| skip 1
|
||||
| first 4
|
||||
| split column "="
|
||||
| sort-by Column1
|
||||
| sort-by column1
|
||||
| skip 1
|
||||
| first 1
|
||||
| get Column1
|
||||
| get column1
|
||||
| str trim
|
||||
"#
|
||||
));
|
||||
@@ -36,7 +36,7 @@ fn by_invalid_column() {
|
||||
| sort-by ColumnThatDoesNotExist
|
||||
| skip 1
|
||||
| first 1
|
||||
| get Column1
|
||||
| get column1
|
||||
| str trim
|
||||
"#
|
||||
));
|
||||
|
@@ -19,7 +19,7 @@ fn to_column() {
|
||||
| lines
|
||||
| str trim
|
||||
| split column ","
|
||||
| get Column2
|
||||
| get column2
|
||||
"#
|
||||
));
|
||||
|
||||
|
@@ -199,7 +199,7 @@ fn from_csv_text_skipping_headers_to_table() {
|
||||
r#"
|
||||
open los_tres_amigos.txt
|
||||
| from csv --noheaders
|
||||
| get Column3
|
||||
| get column3
|
||||
| length
|
||||
"#
|
||||
));
|
||||
|
@@ -8,7 +8,7 @@ fn from_ods_file_to_table() {
|
||||
open sample_data.ods
|
||||
| get SalesOrders
|
||||
| get 4
|
||||
| get Column2
|
||||
| get column2
|
||||
"#
|
||||
));
|
||||
|
||||
|
@@ -74,7 +74,7 @@ fn from_ssv_text_treating_first_line_as_data_with_flag() {
|
||||
open oc_get_svc.txt
|
||||
| from ssv --noheaders -a
|
||||
| first
|
||||
| get Column1
|
||||
| get column1
|
||||
"#
|
||||
));
|
||||
|
||||
@@ -84,8 +84,8 @@ fn from_ssv_text_treating_first_line_as_data_with_flag() {
|
||||
open oc_get_svc.txt
|
||||
| from ssv --noheaders
|
||||
| first
|
||||
| get Column1
|
||||
|
||||
| get column1
|
||||
|
||||
"#
|
||||
));
|
||||
|
||||
|
@@ -122,7 +122,7 @@ fn from_tsv_text_skipping_headers_to_table() {
|
||||
r#"
|
||||
open los_tres_amigos.txt
|
||||
| from tsv --noheaders
|
||||
| get Column3
|
||||
| get column3
|
||||
| length
|
||||
"#
|
||||
));
|
||||
|
@@ -8,7 +8,7 @@ fn from_excel_file_to_table() {
|
||||
open sample_data.xlsx
|
||||
| get SalesOrders
|
||||
| get 4
|
||||
| get Column2
|
||||
| get column2
|
||||
"#
|
||||
));
|
||||
|
||||
|
Reference in New Issue
Block a user