From patchwork Wed Apr 23 14:08:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 41955 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A7F8227BC4A; Wed, 23 Apr 2025 15:10:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 13A9427BC49 for ; Wed, 23 Apr 2025 15:10:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u7ane-0005SX-4l; Wed, 23 Apr 2025 10:10:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u7anc-0005QE-Ax for guix-patches@gnu.org; Wed, 23 Apr 2025 10:10:04 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7anb-0008UE-US for guix-patches@gnu.org; Wed, 23 Apr 2025 10:10:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:From:Date:To:Subject; bh=Pk7T0ukeHgUQJp2NniHFi7s0GqFRlOl+JbRVi2JvZNc=; b=WJY/Rf5nAmiTCAjKwo9R7VABzkC7Gx/6IWPqH/su+icqUu3GCJoEEUIoU4R4c9DK35aXSjntPQBjR5OP5Imi7sfVBZKi5Zke/B3/fssRDUwFU/SezaN6zZmyy18Oe7l44VDkc9o48jGR0IBK8o1CFIzaiN8H57Pk70IrZ4UtaJRrCvpI/dR9DvxDReS/TwwZxmZkaSMgGRH5Jzdwnuzaf6/+VJwqpdZ08vDYLsVHuBTRpYAwe+9AhRTbTcy3QtRc725k0N0JuvXdtXoJUPSxcHD/LFpotMD99eIJsYhTk/azahB8B61DCp1c7Y6DcUVDP9MJixQIr8t3fK1h09PjfQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u7anb-0007AJ-7n for guix-patches@gnu.org; Wed, 23 Apr 2025 10:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78013] [PATCH] guix: toml: Add missing escape pattern. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Apr 2025 14:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78013 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78013@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174541736327106 (code B ref -1); Wed, 23 Apr 2025 14:10:03 +0000 Received: (at submit) by debbugs.gnu.org; 23 Apr 2025 14:09:23 +0000 Received: from localhost ([127.0.0.1]:58146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7amw-000730-O0 for submit@debbugs.gnu.org; Wed, 23 Apr 2025 10:09:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:44396) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7amu-00071h-AV for submit@debbugs.gnu.org; Wed, 23 Apr 2025 10:09:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u7amo-0005KP-EE for guix-patches@gnu.org; Wed, 23 Apr 2025 10:09:14 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1u7amk-0008Nt-4h for guix-patches@gnu.org; Wed, 23 Apr 2025 10:09:12 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4ZjLYx6jJcz9tJp for ; Wed, 23 Apr 2025 16:08:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1745417334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=Pk7T0ukeHgUQJp2NniHFi7s0GqFRlOl+JbRVi2JvZNc=; b=My0nv2TtK6lTy4i8fx1fLZANeD/6MMuRJvIZL3S+lEX3552ZF18wgH70w6b35GhA9ug558 DbtWBkXU598I9tWhPbxDz74cE9SqlcZB4Rgy8fSY+9hYhGMO6Mqji5UvVA2RVrhgCI0Pub xTTB00duxG4vAM2EX18DEfhxhkv4DOVEySQ6usyFQS/A5HblxQmCPh3YLa0HJp/eCeeaoT 0ZNsqQbqf73Z8/cjLBgwCoMcveRgpidJL/HvFbwQYJGfqk6+21SSiVfJel7wgk9c7wgwFX 6Yp1Yv+ZVcNKG6gdOD7oJAgwU/N8Wg11V0o/YKuQI/FISKBZ3qGuIBtyh0sykA== Date: Wed, 23 Apr 2025 16:08:52 +0200 From: Lars-Dominik Braun Message-ID: <36f5a72646c66b618e3625c7d2b8706fe36174cd.1745417268.git.lars@6xq.net> MIME-Version: 1.0 Content-Disposition: inline Received-SPF: pass client-ip=80.241.56.171; envelope-from=lars@6xq.net; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/build/toml.scm (eval-toml-file): Add missing mappings. * tests/toml.scm ("parse-toml: String escapes"): Test all escapes from the specification. Change-Id: I135f6eebd8c7903eb6ebac1120c0ef071779f4ec --- guix/build/toml.scm | 2 ++ tests/toml.scm | 4 ++++ 2 files changed, 6 insertions(+) base-commit: b12d44dd5e35ac236bf3fbb5619b9c8c2f42c902 diff --git a/guix/build/toml.scm b/guix/build/toml.scm index a9be0887e7..7d8b7ed834 100644 --- a/guix/build/toml.scm +++ b/guix/build/toml.scm @@ -402,6 +402,8 @@ (define (eval-toml-file parse-tree) (('escaped "b") "\b") (('escaped "t") "\t") (('escaped "n") "\n") + (('escaped "f") "\f") + (('escaped "r") "\r") (('escaped (? (lambda (x) (>= (string-length x) 4)) u)) (list->string (list (integer->char (string->number u 16))))) ((? string? s) s)) diff --git a/tests/toml.scm b/tests/toml.scm index 64bc667f0c..083fafa526 100644 --- a/tests/toml.scm +++ b/tests/toml.scm @@ -97,6 +97,10 @@ (define-module (test-toml) '(("str" . "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF.")) (parse-toml "str = \"I'm a string. \\\"You can quote me\\\". Name\\tJos\\u00E9\\nLocation\\tSF.\"")) +(test-equal "parse-toml: String escapes" + '(("str" . "\b\t\n\f\r\"\\")) + (parse-toml "str = \"\\b\\t\\n\\f\\r\\\"\\\\\"")) + (test-equal "parse-toml: Empty string" '(("str1" . "") ("str2" . "")