mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 22:37:45 +02:00
to json -r
not removing whitespaces fix (#11948)
fixes #11900 # Description Use `serde_json` instead. # User-Facing Changes The problem described in the issue now no longer persists. No whitespace in the output of `to json --raw` Output of unicode escape changed to consistent `\uffff` # Tests + Formatting I corrected all Tests that were affected by this change.
This commit is contained in:
@ -2,12 +2,12 @@ use std assert
|
||||
|
||||
def test_data_multiline [] {
|
||||
let lines = [
|
||||
"{\"a\": 1}",
|
||||
"{\"a\": 2}",
|
||||
"{\"a\": 3}",
|
||||
"{\"a\": 4}",
|
||||
"{\"a\": 5}",
|
||||
"{\"a\": 6}",
|
||||
"{\"a\":1}",
|
||||
"{\"a\":2}",
|
||||
"{\"a\":3}",
|
||||
"{\"a\":4}",
|
||||
"{\"a\":5}",
|
||||
"{\"a\":6}",
|
||||
]
|
||||
|
||||
if $nu.os-info.name == "windows" {
|
||||
@ -73,7 +73,7 @@ def to_ndjson_multiple_objects [] {
|
||||
def to_ndjson_single_object [] {
|
||||
use std formats *
|
||||
let result = [{a:1}] | to ndjson | str trim
|
||||
let expect = "{\"a\": 1}"
|
||||
let expect = "{\"a\":1}"
|
||||
assert equal $result $expect "could not convert to NDJSON"
|
||||
}
|
||||
|
||||
@ -89,6 +89,6 @@ def to_jsonl_multiple_objects [] {
|
||||
def to_jsonl_single_object [] {
|
||||
use std formats *
|
||||
let result = [{a:1}] | to jsonl | str trim
|
||||
let expect = "{\"a\": 1}"
|
||||
let expect = "{\"a\":1}"
|
||||
assert equal $result $expect "could not convert to JSONL"
|
||||
}
|
||||
|
Reference in New Issue
Block a user