Skip to content

Commit

Permalink
[Truffle] Tag specs instead of excluding them. Before blocks are not …
Browse files Browse the repository at this point in the history
…run if there is no example.

* To add tags:
  ruby spec/mspec/bin/mspec tag --unguarded --all --add fails -B spec/truffle/truffle.mspec spec/ruby/core/dir/glob_spec.rb -Z
  • Loading branch information
eregon committed Feb 13, 2015
1 parent 0bc371a commit 2aa2d23
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 3 deletions.
51 changes: 51 additions & 0 deletions spec/truffle/tags/core/dir/element_reference_tags.txt
@@ -0,0 +1,51 @@
fails:Dir.[] raises an Encoding::CompatibilityError if the argument encoding is not compatible with US-ASCII
fails:Dir.[] calls #to_path to convert a pattern
fails:Dir.[] splits the string on \0 if there is only one string given
fails:Dir.[] matches non-dotfiles with '*'
fails:Dir.[] returns empty array when empty pattern provided
fails:Dir.[] matches regexp special +
fails:Dir.[] matches regexp special *
fails:Dir.[] matches regexp special ?
fails:Dir.[] matches regexp special |
fails:Dir.[] matches regexp special ^
fails:Dir.[] matches regexp special $
fails:Dir.[] matches regexp special (
fails:Dir.[] matches regexp special )
fails:Dir.[] matches regexp special [
fails:Dir.[] matches regexp special ]
fails:Dir.[] matches regexp special {
fails:Dir.[] matches regexp special }
fails:Dir.[] matches paths with glob patterns
fails:Dir.[] matches dotfiles with '.*'
fails:Dir.[] matches non-dotfiles with '*<non-special characters>'
fails:Dir.[] matches dotfiles with '.*<non-special characters>'
fails:Dir.[] matches files with any ending with '<non-special characters>*'
fails:Dir.[] matches files with any middle with '<non-special characters>*<non-special characters>'
fails:Dir.[] handles directories with globs
fails:Dir.[] matches files with multiple '*' special characters
fails:Dir.[] matches non-dotfiles in the current directory with '**'
fails:Dir.[] matches dotfiles in the current directory with '.**'
fails:Dir.[] recursively matches any nondot subdirectories with '**/'
fails:Dir.[] recursively matches any subdirectories including ./ and ../ with '.**/'
fails:Dir.[] matches a single character except leading '.' with '?'
fails:Dir.[] accepts multiple '?' characters in a pattern
fails:Dir.[] matches any characters in a set with '[<characters>]'
fails:Dir.[] matches any characters in a range with '[<character>-<character>]'
fails:Dir.[] matches any characters except those in a set with '[^<characters>]'
fails:Dir.[] matches any characters except those in a range with '[^<character>-<character]'
fails:Dir.[] matches any one of the strings in a set with '{<string>,<other>,...}'
fails:Dir.[] matches a set '{<string>,<other>,...}' which also uses a glob
fails:Dir.[] accepts string sets with empty strings with {<string>,,<other>}
fails:Dir.[] matches dot or non-dotfiles with '{,.}*'
fails:Dir.[] respects the order of {} expressions, expanding left most first
fails:Dir.[] respects the optional nested {} expressions
fails:Dir.[] matches special characters by escaping with a backslash with '\<character>'
fails:Dir.[] recursively matches directories with '**/<characters>'
fails:Dir.[] preserves the separator between directory components
fails:Dir.[] ignores matching through directories that doen't exist
fails:Dir.[] ignores matching only directories under an nonexistant path
fails:Dir.[] matches UTF-8 paths
fails:Dir.[] calls #to_path to convert multiple patterns
fails:Dir.[] matches multiple recursives
fails:Dir.[] ignores symlinks
fails:Dir.[] returns Strings in the encoding of the pattern
64 changes: 64 additions & 0 deletions spec/truffle/tags/core/dir/glob_tags.txt
@@ -0,0 +1,64 @@
fails:Dir.glob raises an Encoding::CompatibilityError if the argument encoding is not compatible with US-ASCII
fails:Dir.glob calls #to_path to convert a pattern
fails:Dir.glob splits the string on \0 if there is only one string given
fails:Dir.glob matches non-dotfiles with '*'
fails:Dir.glob returns empty array when empty pattern provided
fails:Dir.glob matches regexp special +
fails:Dir.glob matches regexp special *
fails:Dir.glob matches regexp special ?
fails:Dir.glob matches regexp special |
fails:Dir.glob matches regexp special ^
fails:Dir.glob matches regexp special $
fails:Dir.glob matches regexp special (
fails:Dir.glob matches regexp special )
fails:Dir.glob matches regexp special [
fails:Dir.glob matches regexp special ]
fails:Dir.glob matches regexp special {
fails:Dir.glob matches regexp special }
fails:Dir.glob matches paths with glob patterns
fails:Dir.glob matches dotfiles with '.*'
fails:Dir.glob matches non-dotfiles with '*<non-special characters>'
fails:Dir.glob matches dotfiles with '.*<non-special characters>'
fails:Dir.glob matches files with any ending with '<non-special characters>*'
fails:Dir.glob matches files with any middle with '<non-special characters>*<non-special characters>'
fails:Dir.glob handles directories with globs
fails:Dir.glob matches files with multiple '*' special characters
fails:Dir.glob matches non-dotfiles in the current directory with '**'
fails:Dir.glob matches dotfiles in the current directory with '.**'
fails:Dir.glob recursively matches any nondot subdirectories with '**/'
fails:Dir.glob recursively matches any subdirectories including ./ and ../ with '.**/'
fails:Dir.glob matches a single character except leading '.' with '?'
fails:Dir.glob accepts multiple '?' characters in a pattern
fails:Dir.glob matches any characters in a set with '[<characters>]'
fails:Dir.glob matches any characters in a range with '[<character>-<character>]'
fails:Dir.glob matches any characters except those in a set with '[^<characters>]'
fails:Dir.glob matches any characters except those in a range with '[^<character>-<character]'
fails:Dir.glob matches any one of the strings in a set with '{<string>,<other>,...}'
fails:Dir.glob matches a set '{<string>,<other>,...}' which also uses a glob
fails:Dir.glob accepts string sets with empty strings with {<string>,,<other>}
fails:Dir.glob matches dot or non-dotfiles with '{,.}*'
fails:Dir.glob respects the order of {} expressions, expanding left most first
fails:Dir.glob respects the optional nested {} expressions
fails:Dir.glob matches special characters by escaping with a backslash with '\<character>'
fails:Dir.glob recursively matches directories with '**/<characters>'
fails:Dir.glob preserves the separator between directory components
fails:Dir.glob ignores matching through directories that doen't exist
fails:Dir.glob ignores matching only directories under an nonexistant path
fails:Dir.glob matches UTF-8 paths
fails:Dir.glob matches multiple recursives
fails:Dir.glob ignores symlinks
fails:Dir.glob can take an array of patterns
fails:Dir.glob calls #to_path to convert multiple patterns
fails:Dir.glob matches both dot and non-dotfiles with '*' and option File::FNM_DOTMATCH
fails:Dir.glob matches files with any beginning with '*<non-special characters>' and option File::FNM_DOTMATCH
fails:Dir.glob matches any files in the current directory with '**' and option File::FNM_DOTMATCH
fails:Dir.glob recursively matches any subdirectories except './' or '../' with '**/' from the current directory and option File::FNM_DOTMATCH
fails:Dir.glob recursively matches any subdirectories except './' or '../' with '**/' and option File::FNM_DOTMATCH
fails:Dir.glob matches a list of paths by concatenating their individual results
fails:Dir.glob accepts a block and yields it with each elements
fails:Dir.glob ignores non-dirs when traversing recursively
fails:Dir.glob matches nothing when given an empty list of paths
fails:Dir.glob handles infinite directory wildcards
fails:Dir.glob matches the literal character '\' with option File::FNM_NOESCAPE
fails:Dir.glob returns nil for directories current user has no permission to read
fails:Dir.glob with encoding returns Strings in the encoding of the pattern
4 changes: 1 addition & 3 deletions spec/truffle/truffle.mspec
Expand Up @@ -20,10 +20,8 @@ class MSpecScript
"spec/ruby/core",

# Can't load these - so tags aren't enough to exclude them. The problem is
# either fixtures or 'before' blocks. Some of them are probably easy fixes.
# either fixtures or syntax. Some of them are probably easy fixes.

"^spec/ruby/core/dir/element_reference_spec.rb",
"^spec/ruby/core/dir/glob_spec.rb",
"^spec/ruby/core/enumerable/find_index_spec.rb",
"^spec/ruby/core/enumerable/to_a_spec.rb",
"^spec/ruby/core/enumerable/to_h_spec.rb",
Expand Down

2 comments on commit 2aa2d23

@eregon
Copy link
Member Author

@eregon eregon commented on 2aa2d23 Feb 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisseaton @nirvdrum What do you think?
Is it not better to just tag every example like this instead of excluding whole files? There are probably still a few cases where we can not load fixtures properly or we have parse errors, but I would expect most of them to load fine.

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eregon I think this was always the intent. The globally excluded files just couldn't be loaded, in my experience. Maybe we were doing something wrong or just by natural evolution of the codebase, they can be loaded now. We should probably validate the remaining excluded files as well.

Please sign in to comment.