github.com/getgauge/gauge@v1.6.9/parser/tableParser_test.go (about)

     1  /*----------------------------------------------------------------
     2   *  Copyright (c) ThoughtWorks, Inc.
     3   *  Licensed under the Apache License, Version 2.0
     4   *  See LICENSE in the project root for license information.
     5   *----------------------------------------------------------------*/
     6  
     7  package parser
     8  
     9  import (
    10  	. "gopkg.in/check.v1"
    11  )
    12  
    13  func (s *MySuite) TestIgnoreCommentLines(c *C) {
    14  	csvContents := "one,two,three\nfoo,bar,baz\n#john,jim,jan"
    15  	table, err := convertCsvToTable(csvContents)
    16  
    17  	if err != nil {
    18  		c.Fail()
    19  	}
    20  
    21  	c.Assert(table.GetRowCount(), Equals, 1)
    22  	c.Assert(table.Rows()[0][0], Equals, "foo")
    23  	c.Assert(table.Rows()[0][1], Equals, "bar")
    24  	c.Assert(table.Rows()[0][2], Equals, "baz")
    25  }