hashicorp / hcl2

Former temporary home for experimental new version of HCL
https://github.com/hashicorp/hcl
Mozilla Public License 2.0
373 stars 66 forks source link

hclpack: fix marshalling binary file index positions #75

Closed akupila closed 5 years ago

akupila commented 5 years ago

When marshalling positions into binary, the current file index was not stored. Because of this, a ; was inserted multiple times for each file, even if the file did not change.

When unmarshalling, the fileIdx determined by number of ; was ignored. Thus, if there were more than one file, all the positions would still point to the first file.

This was likely intended to be there in the first place but was just missed.

codecov-io commented 5 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@819a65a). Click here to learn what that means. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #75   +/-   ##
=========================================
  Coverage          ?   65.74%           
=========================================
  Files             ?       97           
  Lines             ?    10241           
  Branches          ?        0           
=========================================
  Hits              ?     6733           
  Misses            ?     3179           
  Partials          ?      329
Impacted Files Coverage Δ
hclpack/positions_packed.go 82.06% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 819a65a...97a2b10. Read the comment docs.