Commit d064eb23 authored by Mikaël Salson's avatar Mikaël Salson

clone.js: Positions start at 0 in the code but at 1 in the JSON

This is a bit tricky, we should warn coders properly.
And we test that this is actually the case.

See c3bbaf4c
parent 60a6af10
......@@ -22,7 +22,10 @@
*/
/**
* Clone object, store clone information and provide useful access function
* Clone object, store clone information and provide useful access function.
*
* BEWARE! Positions inside the seg field start at 0
*
* @constructor Clone
* @param {object} data - json style object, come directly from .vidjil file
* @param {Model} model
......
......@@ -116,9 +116,11 @@ var json_clone5 = {
QUnit.test("name, informations, getHtmlInfo", function(assert) {
assert.equal(json_clone1.seg.junction.start, 10, "Start junction is 10 in JSON for clone 1");
var m = new Model();
m.parseJsonData(json_data)
var c1 = new Clone(json_clone1, m, 0)
assert.equal(c1.seg.junction.start, 9, "Start junction is now 9 for clone 1 as positions start at 0 in the code");
var c2 = new Clone(json_clone2, m, 1)
var c3 = new Clone(json_clone3, m, 2)
var c4 = new Clone(json_clone4, m, 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment