Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow is not found #1

Closed
etorreborre opened this issue Jul 20, 2012 · 2 comments
Closed

Arrow is not found #1

etorreborre opened this issue Jul 20, 2012 · 2 comments

Comments

@etorreborre
Copy link

I think I have a bug with the diagram parsing. When I enter the following diagram:

val graph =              
  """                    
    |  +-------+         
    |  | op1   |         
    |  +-------+         
    |    |               
    |    |               
    |    ----            
    |       |            
    |       v            
    |    +-----+         
    |    |gbk1 |         
    |    +-----+         
  """.stripMargin('|')   

Then the edge between op1 and gbk1 doesn't have any arrow. This is a problem for me because I need to work with a directed graph.

@mdr
Copy link
Owner

mdr commented May 9, 2013

Hmm, I couldn't reproduce your problem, e.g. I get an edge correctly here:

val diagram = Diagram("""
  +-------+         
  | op1   |         
  +-------+         
    |               
    |               
    ----            
       |            
       v            
    +-----+         
    |gbk1 |         
    +-----+         """)

{
  val boxes = diagram.allBoxes
  val Some(op1) = boxes.find(_.text.contains("op1"))
  val Some(gbk1) = boxes.find(_.text.contains("gbk1"))
  val List(edge) = op1.edges
  edge.hasArrow1 should be(false)
  edge.hasArrow2 should be(true)
}

{
  val graph = Graph.fromDiagram(diagram)
  val Some(op1) = graph.vertices.find(_ contains ("op1"))
  val Some(gbk1) = graph.vertices.find(_ contains ("gbk1"))
  val List(edge) = graph.edges
  edge should be ((op1, gbk1))
}

@etorreborre
Copy link
Author

Hi Matt, let's close this for now then, I'll reopen it if I can send you a fully reproducible test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants