+#if GDB_SELF_TEST
+
+/* Test that disabling the pager does not also disable word
+ wrapping. */
+
+static void
+test_pager ()
+{
+ string_file *strfile = new string_file ();
+ pager_file pager (strfile);
+
+ /* Make sure the pager is disabled. */
+ scoped_restore save_enabled
+ = make_scoped_restore (&pagination_enabled, false);
+ scoped_restore save_disabled
+ = make_scoped_restore (&pagination_disabled_for_command, false);
+ scoped_restore save_batch
+ = make_scoped_restore (&batch_flag, false);
+ scoped_restore save_lines
+ = make_scoped_restore (&lines_per_page, 50);
+ /* Make it easy to word wrap. */
+ scoped_restore save_chars
+ = make_scoped_restore (&chars_per_line, 15);
+ scoped_restore save_printed
+ = make_scoped_restore (&chars_printed, 0);
+
+ pager.puts ("aaaaaaaaaaaa");
+ pager.wrap_here (2);
+ pager.puts ("bbbbbbbbbbbb\n");
+
+ SELF_CHECK (strfile->string () == "aaaaaaaaaaaa\n bbbbbbbbbbbb\n");
+}
+
+#endif /* GDB_SELF_TEST */
+