useocl / use

Home of the UML-based Specification Environment (USE)
GNU General Public License v2.0
38 stars 16 forks source link

Sequence->insertAt(index, elem) inserts elem at the wrong position #43

Closed h-man2 closed 2 years ago

h-man2 commented 2 years ago

Describe the bug The operation insertAt(index, elem) on type Sequence inserts the element elem at the wrong position:

?Sequence{7,8,9}->insertAt(1,42)
=> Sequence{7, 42, 8, 9}

The correct position would be the first position since OCL is 1 based 🥲 :

?Sequence{7,8,9}->insertAt(1,42)
=> Sequence{42, 7, 8, 9}

To Reproduce Steps to reproduce the behavior:

  1. Go to shell
  2. Enter expression staring with ?
  3. See error

Expected behavior The Element is put at the position using a 1-based Sequence instead of a 0-based one.

h-man2 commented 2 years ago

Integration tests should be places in t001.in