File: test_slsmg.sl

package info (click to toggle)
slang2 2.3.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,488 kB
  • sloc: ansic: 101,756; sh: 3,435; makefile: 1,046; pascal: 440
file content (42 lines) | stat: -rw-r--r-- 991 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
() = evalfile ("./test.sl");

% TODO:
% The test plan is to write output to a file and compare that output to a
% validated output file.  Such a test cannot rely upon using a system
% provided terminfo database, which could vary from system to system.
% As such, a TERMCAP environment variable will be used.

try
{
   if (NULL == getenv("TERM"))
     {
	() = fprintf (stderr, "TERM environment variable not set--- slsmg-module test not performed\n");
	exit (0);
     }
#if$TERM unknown
   () = fprintf (stderr, "TERM is unknown-- slsmg-module not tested\n");
   exit (0);
#endif
   require ("slsmg");
}
catch ImportError:
{
   () = fprintf (stderr, "slsmg-module not available.  Test not performed\n");
   exit (1);
}

private define test_smg ()
{
   slsmg_init_smg ();
   slsmg_refresh ();
   variable line;
   () = fgets (&line, stdin);
   slsmg_reset_smg ();
}

define slsh_main ()
{
   testing_module ("slsmg"); ()=fputs("(module loaded)...", stdout);
   %test_smg ();
   end_test ();
}