Шаблон:Str mid/testcases: различия между версиями

Материал из Янтарной ноосферы, свободной интернет-энциклопедии
м (→‎Regular: добавил примеры)
м (2 версии импортировано: попробуем)
 
(нет различий)

Текущая версия от 18:05, 10 февраля 2023

Шаблон:Тесты шаблона

input params 2,3,4[править код]

Regular[править код]

  • abc;1;26: Abcdefghijklmnopqrstuvwxyz
  • abc;10;5: jklmn
  • abc;27;5:String Module Error: String subset index out of range
  • abc;25;5: yz
  • abc;10;;: jklmnopqrstuvwxyz
  • abc;;6;: Abcdef
  • abc;6;200: fghijklmnopqrstuvwxyz
  • abc;6;200: fghijklmnopqrstuvwxyz

Use param 4 (index j) not sublength[править код]

  • abc;10;15: jklmno
  • abc;10; jklmnopqrstuvwxyz
  • abc;;6: Abcdef

blank params[править код]

blank string
  • :
  • ;5:
  • ;;5:
  • ;;;5:
  • ;6;7;8:
blank for numbers
  • abc: Abcdefghijklmnopqrstuvwxyz
  • abc;: Abcdefghijklmnopqrstuvwxyz
  • abc;;: Abcdefghijklmnopqrstuvwxyz
  • abc;;;: Abcdefghijklmnopqrstuvwxyz
  • abc;2=: Abcdefghijklmnopqrstuvwxyz
  • abc;2=;3=: Abcdefghijklmnopqrstuvwxyz
  • abc;2=;3=;4=: Abcdefghijklmnopqrstuvwxyz
  • abc;;3=: Abcdefghijklmnopqrstuvwxyz
  • abc;;;4=: Abcdefghijklmnopqrstuvwxyz
  • abc;2=;;4=: Abcdefghijklmnopqrstuvwxyz

i < 0[править код]

  • abc;-10;: qrstuvwxyz
  • abc;-10;7: qrstuvw

i < 0, using j[править код]

  • abc;-10;;20: qrst
  • abc;-10;;-7: qrst
  • abc;-10;;-10: q
  • abc;-10;;7:String Module Error: String subset indices out of order

sublen<0[править код]

  • abc;2=5;3=-3: cde
  • abc;2=7;3=-3: efg
  • abc;;3=-3;j=10: jklmnopqrstuvwxyz
  • abc;;3=3;j=10: Abcdefghij
  • abc;2=7;3=-3: efg
  • abc;;3=-3: z TODO apply logic: from the end
  • abc;;3=-10;4=30: z (check this: j=30 or j=26?)

Zeros[править код]

  • abc;0:String Module Error: String subset index out of range
  • abc;5;0:
  • abc;5;;0:String Module Error: String subset index out of range
  • abc;0;0;0:
  • abc;2=;: Abcdefghijklmnopqrstuvwxyz
  • abc;2=5;3=0:
  • abc;2=5;j=0:String Module Error: String subset index out of range

Input errors[править код]

  • abc;2=2;3=3;7: Шаблон:Error
  • abc;;2=foo; Abcdefghijklmnopqrstuvwxyz
  • abc;3=foo; Ошибка выражения: неопознанное слово «foo»
  • abc;2=foo;3=bar; Ошибка выражения: неопознанное слово «bar»

Index errors[править код]

Triangular calculation check
other
  • abc;0:String Module Error: String subset index out of range
  • abc;3;0:
  • abc;0;;15:String Module Error: String subset index out of range
  • abc;10;;7:String Module Error: String subset indices out of order
  • abc;-5;26:String Module Error: String subset indices out of order
  • abc;-1;5:String Module Error: String subset indices out of order

Error message suppression[править код]

  • abc;0;10; ignore errors=false:String Module Error: String subset index out of range
  • abc;0;10; ignore errors=true:
  • abc;0;5: ignore errors=false; ignore errors=false:String Module Error: String subset index out of range
  • abc;0;5:ignore errors=true: