1
#### include/show_msg80.inc
3
# This file writes the value set in @message into the a protocol file as part
4
# of executing a test sequence with a dash line that is fixed on 80 characters.
6
# This can be used in the case of long messages, multi line messages that
7
# exceed 80 or if an 80 char line is desired for short messages.
10
# Add the following to any *.test file:
12
# let $message= <value>;
13
# --source include/show_msg80.inc
17
# - Please do not write any spaces between $message and the "=", because the
18
# assignment will not work.
19
# - Be careful with single quotes within the value. They must be escaped like
21
# - Do not keep the value between single quotes.
24
# Content of "$message" and protocol output depending on the assignment:
25
# ----------------------------------------------------------------------
27
# I is assumed, that the value is not kept between double quotes.
29
# <x> first character after "$message=",
30
# where the content is not (space or tab)
31
# <y*> first character after beginning of the line,
32
# where the content is not (space or tab)
33
# <z> last char before ";"
34
# | beginning or end of line
36
# script: let $message= <x><whatever0>|
39
# | <yn><whatevern><z>;
40
# content: "<x><whatever0><new line><y1><whatever1><new line>
41
# ....<new line><yn><whatevern><z>"
42
# protocol output: |<x><whatever0>|
45
# |<yn><whatevern><z>|
49
# <x> and <y*> set to characters like "-$#" which are also used
50
# to start comments, options and the names of mysqltest variables
51
# lead to syntax errors or mangled messages.
54
# Examples of messages:
55
# ---------------------
57
# Variant1 (ease of use):
58
# Several lines with indentation kept between double quotes
59
# script: |let $message=
60
# |" Testcase 3.1 : Ensure that Pi is not an|
63
# protocol: |" Testcase 3.1 : Ensure that Pi is not an|
66
# |------ 80 dashes ----|
69
# - the '"' preserves the indentation.
70
# - it is easy to write the script lines to get a fine indentation,
71
# if the value starts at the beginning of a new line
72
# - the '"' is printed
73
# - there are the least or no problems with characters like "-#$"
76
# Variant 2 (grep the messages from the protocol is easy):
77
# Several lines with indentation + auxiliary character (".")
78
# at the (non tab or space) beginning of every message line
79
# script: |let $message= . Testcase 3.1 : Ensure that Pi is not an|
80
# | . integer number.|
82
# protocol: |. Testcase 3.1 : Ensure that Pi is not an|
85
# |------ 80 dashes ----|
87
# - the auxiliary character preserves the indentation.
88
# - it is easy to write the script lines to get a fine indentation
89
# - the auxiliary character is printed
90
# - it is recommended to use "." as auxiliary character
91
# - auxiliary characters like "-'$#" cause problems
95
# Bad variant1: Several lines with lost indentation
96
# script: |let $message= Here is message line 1
98
# protocol: |Here is message line 1|
100
# |------ 80 dashes ----|
101
# Please mention, that the leading spaces of the message lines disappeared.
103
# Bad variant2: Several lines leading to a syntax error, because of "-"
104
# script: |let $message= - This is a message
105
# | - with a second and
107
# protocol: | - third line;;
108
# |ERROR 42000: You have an error ... near '- third line'
109
# + several following errors
114
eval SET @utf8_message = CONVERT('$message' using utf8);
115
select @utf8_message as ""
117
select repeat(CONVERT('-' using utf8),80);