[Pkg-jed-commit] r942 - in jed-extra/trunk: tests utils

Guenter Milde milde-guest at alioth.debian.org
Fri Oct 19 08:03:38 UTC 2007


Author: milde-guest
Date: 2007-10-19 08:03:37 +0000 (Fri, 19 Oct 2007)
New Revision: 942

Modified:
   jed-extra/trunk/tests/ch_table-lat1-decimal.txt
   jed-extra/trunk/tests/ch_table-utf8-decimal.txt
   jed-extra/trunk/tests/datutils-test.sl
   jed-extra/trunk/tests/ishell-test.sl
   jed-extra/trunk/tests/rst-test.sl
   jed-extra/trunk/tests/utf8helper-autoconvert-test.sl
   jed-extra/trunk/utils/do-unittests.sl
Log:
test suite update

Modified: jed-extra/trunk/tests/ch_table-lat1-decimal.txt
===================================================================
--- jed-extra/trunk/tests/ch_table-lat1-decimal.txt	2007-10-18 16:38:21 UTC (rev 941)
+++ jed-extra/trunk/tests/ch_table-lat1-decimal.txt	2007-10-19 08:03:37 UTC (rev 942)
@@ -27,3 +27,5 @@
  230	æ	ç	è	é	ê	ë	ì	í	î	ï
  240	ð	ñ	ò	ó	ô	õ	ö	÷	ø	ù
  250	ú	û	ü	ý	þ	ÿ
+
+High-bit chars in a row: ähä öö üÜ ßßß

Modified: jed-extra/trunk/tests/ch_table-utf8-decimal.txt
===================================================================
--- jed-extra/trunk/tests/ch_table-utf8-decimal.txt	2007-10-18 16:38:21 UTC (rev 941)
+++ jed-extra/trunk/tests/ch_table-utf8-decimal.txt	2007-10-19 08:03:37 UTC (rev 942)
@@ -27,3 +27,5 @@
  230	æ	ç	è	é	ê	ë	ì	í	î	ï
  240	ð	ñ	ò	ó	ô	õ	ö	÷	ø	ù
  250	ú	û	ü	ý	þ	ÿ
+
+High-bit chars in a row: ähä öö üÜ ßßß

Modified: jed-extra/trunk/tests/datutils-test.sl
===================================================================
--- jed-extra/trunk/tests/datutils-test.sl	2007-10-18 16:38:21 UTC (rev 941)
+++ jed-extra/trunk/tests/datutils-test.sl	2007-10-19 08:03:37 UTC (rev 942)
@@ -179,7 +179,41 @@
    test_equal(array_append([1,2,3], 4)   , [1,2,3,4]);
 }
 
+% array_value_exists: library function
+%   Return the number of occurences of `value' in array `a'
+static define test_array_value_exists()
+{
+   % trivial ones (translate to length(where(a == value)) )
+   test_equal(0, array_value_exists([1,2,3], 4));
+   test_equal(1, array_value_exists([1,2,3], 2));
+   test_equal(3, array_value_exists(["1", "1", "1", "W"], "1"));
+   
+   % Any_Type arrays:
+   variable a = Any_Type[4];
+   test_equal(0, array_value_exists(a, 3));
+   test_equal(4, array_value_exists(a, NULL));
+   a[1] = 3;
+   a[2] = "3";
+   a[3] = 3;
+   test_equal(1, array_value_exists(a, NULL));
+   test_equal(2, array_value_exists(a, 3));
+   test_equal(1, array_value_exists(a, "3"));
+}
 
+% assoc_get_key: library function
+%   Return the key of a value of an Associative Array
+static define test_assoc_get_key()
+{
+   variable ass = Assoc_Type[Integer_Type];
+   ass["5"] = 5;
+   ass["3"] = 3;
+   % testmessage("ass %s\n", sprint_variable(ass));
+   % testmessage("values %s\n", sprint_variable(assoc_get_values(ass)));
+   % testmessage("keys %s\n", sprint_variable(assoc_get_keys(ass)));
+   test_equal(NULL, assoc_get_key(ass, 1));
+   test_equal("5", assoc_get_key(ass, 5));
+}
+
 #stop
    
 % pop2array: library function
@@ -283,31 +317,6 @@
    Arr  = array_delete(Arr  a, i N);
 }
 
-
-% array_value_exists: library function
-% 
-%  SYNOPSIS
-%   Return the number of occurences of `value' in array `a'
-% 
-%  USAGE
-%   Integer_Type array_value_exists(a, value)
-% 
-%  DESCRIPTION
-%   Count, how many times `value' is present in array `a'. 
-%   For normal arrays, this is equal to
-% 
-%      length(where(a == value))
-% 
-%   while special care is taken to get meaningfull results with arrays of
-%   `Any_Type'.
-% 
-%  SEE ALSO
-%   where, wherefirst, wherelast, assoc_value_exists
-static define test_array_value_exists()
-{
-   i = array_value_exists(a, value);
-}
-
 % array_repeat: library function
 % 
 %  SYNOPSIS
@@ -363,28 +372,6 @@
    i = assoc_value_exists(Ass ass, value);
 }
 
-% assoc_get_key: library function
-% 
-%  SYNOPSIS
-%   Return the key of a value of an Associative Array
-% 
-%  USAGE
-%   String_Type key = assoc_get_key(ass, value)
-% 
-%  DESCRIPTION
-%   Reverse the usual lookup of an hash table (associative array). Return the
-%   first key whose value is equal to `value'.
-% 
-%  NOTES
-%   Of course, this function is far slower than the corresponding ass[key].
-% 
-%  SEE ALSO
-%   assoc_value_exists
-static define test_assoc_get_key()
-{
-   Str key = assoc_get_key(ass, value);
-}
-
 % push_list: library function
 % 
 %  SYNOPSIS

Modified: jed-extra/trunk/tests/ishell-test.sl
===================================================================
--- jed-extra/trunk/tests/ishell-test.sl	2007-10-18 16:38:21 UTC (rev 941)
+++ jed-extra/trunk/tests/ishell-test.sl	2007-10-19 08:03:37 UTC (rev 942)
@@ -94,7 +94,7 @@
 static define test_terminal()
 {
    % terminal();       % doesnot close!
-   terminal("logout");
+   terminal("exit");
 }
 
 % shell_command(cmd="", output_handling=0); Run a shell command

Modified: jed-extra/trunk/tests/rst-test.sl
===================================================================
--- jed-extra/trunk/tests/rst-test.sl	2007-10-18 16:38:21 UTC (rev 941)
+++ jed-extra/trunk/tests/rst-test.sl	2007-10-19 08:03:37 UTC (rev 942)
@@ -81,8 +81,8 @@
 % public  define rst_to_pdf() % (outfile=path_sans_extname(whatbuf())+".pdf")
 static define test_rst_to_pdf_long()
 {
-   testmessage("rst2pdf still not working");
-   return;
+   % testmessage("rst2pdf still not working");
+   % return;
    
    variable outfile = path_sans_extname(buffer_filename()) + ".pdf";
 
@@ -220,10 +220,10 @@
   
 #ifexists list_routines
 
-% public  define rst_list_routines_extract (nRegexp)
+% static  define rst_list_routines_extract (nRegexp)
 static define test_rst_list_routines_extract()
 {
-   test_equal("", rst_list_routines_extract(0),
+   test_equal("", rst->rst_list_routines_extract(0),
       "should return empty string if not on a section header");
    
    variable adornment = string_repeat("+", strlen(teststring));
@@ -231,42 +231,36 @@
    insert("\n" + adornment);
    % testmessage("\n" + line_as_string);
    bol();
-   test_equal("+ a test line", rst_list_routines_extract(0),
+   test_equal("+ a test line", rst->rst_list_routines_extract(0),
       "should return section header preceded by adornment character");
 
    delete_line();
    insert("------");
    bol();
-   test_equal("", rst_list_routines_extract(0),
+   test_equal("", rst->rst_list_routines_extract(0),
       "should return empty string if underline too short");
 
    newline();
    insert("\n\n------");
    bol();
-   test_equal("", rst_list_routines_extract(0),
+   test_equal("", rst->rst_list_routines_extract(0),
       "should return empty string if on a transition");
 
    newline();
    insert("\n\n::");
    bol();
-   test_equal("", rst_list_routines_extract(0),
+   test_equal("", rst->rst_list_routines_extract(0),
       "should return empty string if on a literal block marker");
 
    newline();
    insert("\n\nsubsection");
    insert(  "\n----------");
    bol();
-   test_equal("  - subsection", rst_list_routines_extract(0),
+   test_equal("  - subsection", rst->rst_list_routines_extract(0),
       "should return sub section header");
 
 }
 
-% public  define rst_list_routines_done()
-static define test_rst_list_routines_done()
-{
-   rst_list_routines_done();
-}
-
 #endif
 
 

Modified: jed-extra/trunk/tests/utf8helper-autoconvert-test.sl
===================================================================
--- jed-extra/trunk/tests/utf8helper-autoconvert-test.sl	2007-10-18 16:38:21 UTC (rev 941)
+++ jed-extra/trunk/tests/utf8helper-autoconvert-test.sl	2007-10-19 08:03:37 UTC (rev 942)
@@ -11,7 +11,10 @@
 % Fixture
 % -------
 
-require("utf8helper");
+% Do not load here, as the hooks are only added !if (_featurep("utf8helper"))
+% require("utf8helper");
+custom_variable("UTF8Helper_Read_Autoconvert", 0);
+custom_variable("UTF8Helper_Write_Autoconvert", 0);
 
 % testbufs[_slang_utf8_ok] is in active encoding
 private variable   teststrings,
@@ -24,9 +27,10 @@
 % set the _jed_*_hooks
 UTF8Helper_Read_Autoconvert = 1;
 UTF8Helper_Write_Autoconvert = 1;
+
+% now evaluate:
 () = evalfile("utf8helper");
 
-
 static define setup()
 {
    teststrings = array_map(String_Type, 

Modified: jed-extra/trunk/utils/do-unittests.sl
===================================================================
--- jed-extra/trunk/utils/do-unittests.sl	2007-10-18 16:38:21 UTC (rev 941)
+++ jed-extra/trunk/utils/do-unittests.sl	2007-10-19 08:03:37 UTC (rev 942)
@@ -29,4 +29,4 @@
 % ignore interactive tests
 
 % test-run the 
-test_files_and_exit("../tests/*");
+test_files_and_exit("../tests/*.sl");




More information about the Pkg-jed-commit mailing list