
#include<SYNERGY/ID.h>

int main(void)
{
  IDLabel id1, id2, id3;
  string p,c;

  while ((p = read_string("\nparent: ")) != "quit")
    {
      c = read_string("\nlocal: ");

      id1 = IDLabel(p); id2 = IDLabel(c, &id1);
      cout << "My name is  = " << id2 << "\nit is = " 
	<< (int) id2.itIs(p+ "/" + c)  << "\nparent = " 
	  << *(id2.parent()) << "\n";

      id3 = IDLabel(id2);
      cout << "My name is  = " << id3 << "\nit is = " 
	<< (int) id3.itIs(p+ "/" + c)  << "\nparent = " 
	  << *(id3.parent()) << "\n";


    };
}

/* Sample correct output, not parent fails as expected when id is local 

ID-test

parent: /a/b/c
local: d
Default without parent Label = d
it is = 0
parent = ERROR 0: IDLabel::parent called when i am localID

UNKNOWN
Default without parent Label = /a/b/c/d
it is = 1
parent = /a/b/c
local = false, Label = /a/b/c/d
it is = 1
parent = /a/b/c
local = true, Label = d
it is = 0
parent = ERROR 0: IDLabel::parent called when i am localID

UNKNOWN
*/
