[Added] Tests for optional dynamic segments

Added four tests. Only 1 (the first one) is succeeding.

These are related to issue #279.

Hope I didn't mess things up too much..