You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/07/02 22:31:57 UTC

svn commit: r1499100 - /subversion/trunk/subversion/tests/libsvn_subr/config-test.c

Author: breser
Date: Tue Jul  2 20:31:57 2013
New Revision: 1499100

URL: http://svn.apache.org/r1499100
Log:
Add test for config files with UTF-8 Byte Order Mark.

* subversion/tests/libsvn_sub/config-test.c
  (test_ignore_bom, test_funcs): Add new test.
  

Modified:
    subversion/trunk/subversion/tests/libsvn_subr/config-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/config-test.c?rev=1499100&r1=1499099&r2=1499100&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/config-test.c Tue Jul  2 20:31:57 2013
@@ -336,6 +336,22 @@ test_stream_interface(apr_pool_t *pool)
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_ignore_bom(apr_pool_t *pool)
+{
+  svn_config_t *cfg;
+  svn_string_t *cfg_string = svn_string_create("\xEE\xBB\xBF[s1]\nfoo=bar\n",
+                                               pool);
+  svn_stream_t *stream = svn_stream_from_string(cfg_string, pool);
+
+  SVN_ERR(svn_config_parse(&cfg, stream, TRUE, TRUE, pool));
+
+  if (! svn_config_has_section(cfg, "s1"))
+    return fail(pool, "failed to find section s1");
+
+  return SVN_NO_ERROR;
+}
+
 /*
    ====================================================================
    If you add a new test to this file, update this array.
@@ -359,5 +375,6 @@ struct svn_test_descriptor_t test_funcs[
                    "test case-sensitive option name lookup"),
     SVN_TEST_PASS2(test_stream_interface,
                    "test svn_config_parse"),
+    SVN_TEST_XFAIL2(test_ignore_bom, "test parsing config file with BOM"),
     SVN_TEST_NULL
   };