-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Two changes: 1) __FL__ lexeme in FStarC_Parser_LexFStar.ml 2) tests/v…
…alidation-time with a Test.LexemeFL.fst that checks __FL__
- Loading branch information
1 parent
61aa90b
commit 9b114bd
Showing
5 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# This does nothing but the default validation as these are validation time test modules. | ||
# Most are let _ = assert(...) which is extremely cool to test at validation time! | ||
# | ||
|
||
WARN_ERROR=--warn_error -321 | ||
FSTAR_HOME=../.. | ||
FSTAR_FILES=$(wildcard *.fst) | ||
FSTAR_EXAMPLES=$(realpath ../../examples) | ||
include $(FSTAR_EXAMPLES)/Makefile.include | ||
|
||
all: verify-all | ||
|
||
include $(FSTAR_HOME)/examples/Makefile.common | ||
|
||
verify-all: $(CACHE_DIR) $(addsuffix .checked, $(addprefix $(CACHE_DIR)/, $(FSTAR_FILES))) | ||
|
||
clean: | ||
$(call msg, "CLEAN") | ||
$(Q)rm -f .depend | ||
$(Q)rm -rf _cache | ||
$(Q)rm -rf _output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
This directory contains tests that run on Make all which only validate F* files. | ||
This allows validation time tests. If any validation fails, the file's tests fail. | ||
|
||
Tests for an F* module FStar.M can be named Test.FStar.M.fst by default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/// A new lexeme __FL__ has been added to show file and line (file(line)) to make writing tests easier. | ||
/// This file is line sensitive any edit will change the value of __FL__. | ||
module Test.LexemeFL | ||
open FStar.Tactics.V2 | ||
open FStar.String | ||
module LT = FStar.List.Tot | ||
// Kinda funky to get a good validation time test, added Strings in other PR will fix this. | ||
// The lexer is sending back some strange character that we have to adjust. | ||
let fl = __FL__ | ||
let _ = assert(fl <> "") | ||
let fl' = string_of_list (list_of_string "Test.LexemFL.fst(11)") | ||
let _ = assert((strlen fl') = 20) by compute() | ||
let _ = assert(fl' = "Test.LexemFL.fst(11)") by compute() |